<!DOCTYPE html><html lang="en">
      
      
        
    
    
    
    

      
      
      <head>
        <meta charset="utf-8">
        <meta name="format-detection" content="telephone=no">  
        
        <title>Lecture 7: Matching Problems | Video Lectures | Mathematics for Computer Science | Electrical Engineering and Computer Science | MIT OpenCourseWare</title>
    <!-- Begin Automatic Metadata Insertion -->
    <meta content="6-042j-mathematics-for-computer-science-fall-2010" name="WT.cg_n">
    <meta content="Lecture 7: Matching Problems" name="WT.cg_s">
    <meta content="Introduces the concept of matching. Discusses the mating algorithm, its fairness, and relation to practical applications." name="Description">
    <meta content="Leighton, Tom" name="Author">
    <meta content="Dijk, Marten van " name="Author">
    <meta content="6.042J,6.042,18.062J,18.062,matching,min-weight matching,rouge couple,mating algorithm,fairness,Computer Science,Probability and Statistics,Applied Mathematics,Discrete Mathematics" name="keywords">
    <meta content="6.042J Mathematics for Computer Science | Lecture 7: Matching Problems" name="Search_Display">
    <meta content="Computer Science" itemprop="about">
    <meta content="Probability and Statistics" itemprop="about">
    <meta content="Applied Mathematics" itemprop="about">
    <meta content="Discrete Mathematics" itemprop="about">
    <!-- End Automatic Metadata Insertion -->

	<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/grid.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/base.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/menu.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.bubblepopup.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/search.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/courses_new.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/jquery.jscrollpane.css">
<link title="default" rel="stylesheet" type="text/css" href="../../../common/styles/media_tabs.css">
	<link href="../../../common/xml/ocwcc.rdf" type="application/rdf+xml" rel="metadata">
	<link rel="canonical" href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-7-matching-problems/">
	<link rel="apple-touch-icon" href="../../../common/images/apple-touch-icon.png">
	
	
      
	
	<script type="text/javascript" src="../../../common/scripts/jquery.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-media-utils-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/ocw-offline.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.bubblepopup.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery-ui.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/jquery.jscrollpane.min.js"></script>
	<script type="text/javascript" src="../../../common/scripts/expandy.js"></script>
	<script type="text/javascript" src="../../../common/scripts/bubble-popup-offline.js"></script>
	
	
	
    <script type="text/javascript">
      $(document).ready(function() {
        $("#tabs").tabs();
        IpadScroller();
      });
    </script>
    
    
    
    
    
    
      
       
		 

        
        
        

        
        
        
        
        
        
        
        
        
      </head>
    <body itemscope itemtype="http://schema.org/WebPage">
        
	

        <header id="top">
			<div id="grid">
				
				
					
<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d686561646572">
<div class="portletStaticText portlet-static-site-header">
<!--googleoff: index-->
<div class="grid_6 alpha" id="banner"><a href="https://ocw.mit.edu/"><img src="../../../common/images/ocw_mast.png" class="logo" alt="MIT OpenCourseWare, Massachusetts Institute of Technology"></a></div>
<div class="grid_6 omega" id="subscribe">
<aside class="module" aria-label="Connect with OCW">
<table class="social">
    <tbody>
        <tr>
            <td class="socialbutton"><a aria-label="Subscribe to the OCW Newsletter" href="https://ocw.mit.edu/subscribe/index.htm?utm_source=header"><img src="../../../common/images/trans.gif" alt="An icon depicting an envelope.">Subscribe to the OCW Newsletter</a></td>
            <td>
<a aria-label="Facebook" href="https://facebook.com/mitocw"><img src="../../../common/images/icon_fb.png" alt="Click to visit our Facebook page."></a>  <a aria-label="Instagram" href="https://www.instagram.com/mitocw/"><img src="https://ocw.mit.edu/images/icon_ig.png" alt="Click to visit our Instagram page."></a> <a aria-label="Twitter" href="https://twitter.com/mitocw"><img src="https://ocw.mit.edu/images/icon_twitter.png" alt="Click to visit our Twitter feed."></a><a aria-label="YouTube" href="https://www.youtube.com/mitocw" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_yt.png" alt="Click to visit our YouTube page."></a><span style="font-size: 12.208px;">   </span><a aria-label="Open Matters blog on WordPress" href="https://www.ocw-openmatters.org/" style="font-size: 12.208px;"><img src="https://ocw.mit.edu/images/icon_wp.png" alt="Click to visit our blog on WordPress."></a>
</td>
        </tr>
    </tbody>
</table>
</aside><nav aria-label="Help Links" class="helplinks">     <a aria-label="OCW Site Help" href="https://ocw.mit.edu/help">Help</a><span aria-hidden="true">|</span>     <a href="../../../common/about/contactus.htm">Contact Us</a>   </nav>
</div>
<div class="clear"> </div>
<!--googleon: index-->
</div>

</div>

<div id="portletwrapper-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75" class="portletWrapper kssattr-portlethash-6f63772e746f70706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a6d6567612d6d656e75">
<div class="portletStaticText portlet-static-mega-menu"><div><nav id="mega" class="grid_8 alpha" aria-label="Site">
<ul id="menu" role="presentation">
    <li id="menu_home">
<a href="https://ocw.mit.edu/" aria-label="Homepage"><img src="../../../common/images/top-nav_home.png" class="home_icon" alt="Click for site home page."></a><!-- Begin Home Item -->
</li>
    <!-- End Home Item -->
    <li id="drop_1" aria-label="Find Courses">
<a href="#" aria-hidden="true">FIND COURSES</a><!-- Begin 5 columns Item -->
    <div class="dropdown_5columns-a mega-courses">
    <div class="col_1a">
    <div class="row_1a">
<nav aria-labelledby="mm-find-courses-by">     <span id="mm-find-courses-by" class="nav" aria-hidden="true">Find courses by:</span>
    <ul class="find_by" role="presentation">
        <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Topic</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-number/">MIT Course Number</a></li>
        <li><a href="https://ocw.mit.edu/courses/find-by-department/">Department</a></li>
    </ul>
    </nav>     <nav aria-labelledby="mm-collections">     <span id="mm-collections" class="nav" aria-hidden="true">Collections</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Lectures</a></li>
        <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
        <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
        <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
        <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    </ul>
    </nav>     <nav class="col_1b" aria-labelledby="mm-translated-courses">     <span id="mm-translated-courses" class="nav" aria-hidden="true" style="line-height: 1.3;">Cross-Disciplinary Topic Lists</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/energy-courses">Energy</a></li>
        <li><a href="https://ocw.mit.edu/courses/entrepreneurship">Entrepreneurship</a></li>
        <li><a href="https://ocw.mit.edu/courses/environment-courses">Environment</a></li>
        <li><a href="https://ocw.mit.edu/courses/intro-programming">Introductory Programming</a></li>
        <li><a href="https://ocw.mit.edu/courses/life-sciences">Life Sciences</a></li>
        <li><a href="https://ocw.mit.edu/courses/transportation-courses">Transportation</a></li>
    </ul>
    </nav>
</div>
    <div class="row_1b"><nav aria-labelledby="mm-cross-disciplinary-topic-lists">     <span id="mm-cross-disciplinary-topic-lists" class="nav" aria-hidden="true">Translated Courses</span>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/translated-courses/traditional-chinese" aria-label="Traditional Chinese">繁體字 / Traditional Chinese</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/turkish" aria-label="Turkish">Türkçe / Turkish</a></li>
        <li><a href="https://ocw.mit.edu/courses/translated-courses/korean" aria-label="Korean">(비디오)한국 / Korean</a></li>
    </ul>
    </nav></div>
    </div>
    </div>
    </li>
    <li id="drop_2">
<a href="#" aria-label="For Educators">For Educators</a>
    <div class="dropdown_1column-a" style="width: 270px;"><nav aria-labelledby="mm-find-courses-by">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/chalk-radio-podcast">Chalk Radio Podcast</a></li>
        <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
        <li><a href="https://openlearning.mit.edu/campus/digital-innovations/">Residential Digital Innovations </a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    </ul>
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_3">
<a href="#" aria-hidden="true">Give Now</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="Donate">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
        <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
        <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
        <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
        <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
    </ul>
    </nav></div>
    </li>
    <li id="drop_4">
<a href="#" aria-hidden="true">About</a>
    <div class="dropdown_1column-a"><nav class="col_1" aria-label="About">
    <ul role="presentation">
        <li><a href="https://ocw.mit.edu/about/">About MIT OpenCourseWare</a></li>
        <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
        <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
        <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
        <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
        <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
    </ul>
    </nav></div>
    </li>
</ul>
</nav></div></div>

</div>





<!--googleoff: index-->
<script>
  (function() {
	var cx = '012626166551961672889:owjdpuboktq';
	var gcse = document.createElement('script');
	gcse.type = 'text/javascript';
	gcse.async = true;
	gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
	var s = document.getElementsByTagName('script')[0];
	s.parentNode.insertBefore(gcse, s);
  })();
  window.onload = function(){
	document.getElementById('gsc-i-id1').placeholder = 'Search';	
  };

$(document).ready(function(){

$('.advanceSearch a').keydown(function(event){showSearchTips($(this),event);})
$('#searchTipsModal').keydown(function(event){showSearchTips($(this),event);})

function showSearchTips(obj,evt) {
// if pressed enter key
	if ( evt.which == 13 || evt.which == 32) {
		showModal();
		ga('send', 'pageview', "AdvanceSearch");
		$(".advanceSearch a").attr('aria-expanded', 'true');
		$('.searchTipsModal').focus();
		evt.preventDefault();
		}
	if ( evt.which == 27 ) {
		hideModal();
		$(".advanceSearch a").attr('aria-expanded', 'false');
		var modal = document.getElementById('searchTipsModal');
		modal.style.display = "none";
		$(".advanceSearch a").focus();
		evt.preventDefault();
		}
}

});
function showModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "block";
	ga('send', 'pageview', "AdvanceSearch");
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", true);
	window.setTimeout(function () {
    document.getElementById('searchTipsModal').focus(); }, 0);
}

function hideModal(){
	var modal = document.getElementById('searchTipsModal');
	modal.style.display = "none";
	document.getElementById("searchTipsBtn").setAttribute("aria-expanded", false);
}
</script>
<div id="search" role="search" class="grid_4 omega">
    	<table class="search">
				<tbody>
					<tr>
						<td><div class="searchboxheader"><searchbox-only resultsurl="/search/ocwsearch.htm"></searchbox-only></div></td>
						<td>
							<div class="advanceSearch">
								<a id="searchTipsBtn" onclick="showModal();" href="#" role="button" aria-label="search tips" aria-expanded="false" aria-describedby="searchtips">Search Tips</a>

								<!-- The Modal -->
								<div id="searchTipsModal" class="modal" tabindex="-1">
								  <!-- Modal content -->
									<div class="modal-content">
										<div class="modal-body">
											<button class="close" onclick="hideModal();" aria-label="close">X</button>
											<span>
												<b>Exclude words from your search</b>
												<br>Put - in front of a word you want to leave out. For example, jaguar speed -car
												<br><br>
												<b>Search for an exact match</b>
												<br>Put a word or phrase inside quotes. For example, "tallest building".
												<br><br>
												<b>Search for wildcards or unknown words</b>
												<br>Put a * in your word or phrase where you want to leave a placeholder. For example, "largest * in the world".
												<br><br>
												<b>Search within a range of numbers</b>
												<br>Put .. between two numbers. For example, camera $50..$100.
												<br><br>
												<b>Combine searches</b>
												<br>Put "OR" between each search query. For example,  marathon OR race.
												<br><br>
											</span>
										</div>
								  </div>
								</div>
							</div>
						</td>
					</tr>
				</tbody>
		</table>
</div>
<div class="clear"></div>
<!--googleon: index-->
<!-- *end header* -->

				
				
			</div>
<!-- top grid end -->
		</header><!-- top end -->
			
		<div id="center_media">
      	<div id="grid">
      		<div id="left">
        		<nav id="breadcrumb_media" aria-label="Breadcrumb">
                	<p>

    <a href="https://ocw.mit.edu/">Home</a>
    
        »
        
    
    
        
            <a href="https://ocw.mit.edu/courses">Courses</a>
            
                »
                
            
            
         
    
    
        
            <a href="https://ocw.mit.edu/courses/electrical-engineering-and-computer-science">Electrical Engineering and Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/index.htm">Mathematics for Computer Science</a>
            
                »
                
            
            
         
    
    
        
            <a href="../../../contents/video-lectures/index.htm">Video Lectures</a>
            
                »
                
            
            
         
    
    
        
            
            
            Lecture 7: Matching Problems
         
    
</p>

            	</nav>
            	<div class="clear"></div>
        		<div id="media_title">
        		<h1 class="title" itemprop="name" property="dct:title">
        <span class="" id="parent-fieldname-title">
            Lecture 7: Matching Problems
        </span>
    </h1>
        		</div>
           		<div class="clear"></div>
           		<div id="course_wrapper_media">
           			<nav id="course_nav" aria-label="Course">
           				<script language="javascript" type="text/javascript">
function toggleMenu(objID) {
  if (!document.getElementById) return;
  var ob = document.getElementById(objID);
  ob.className = (ob.className == 'selected')?'': 'selected';
}
function toggleClass(id)
{
  var divtoggleClass= document.getElementById(id);
  divtoggleClass.className = (divtoggleClass.className == 'mO')?'mC': 'mO';
  return false;
}
function changeAlt(id)
{
  id.alt = (id.alt == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
  id.title = (id.title == 'Expand Menu')?'Collapse Menu' : 'Expand Menu';
}
</script>
<!--Left Nav Starts -->


	<ul>			  
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/index.htm">
		                  Course Home  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/syllabus/index.htm">
		                  Syllabus  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/calendar/index.htm">
		                  Calendar  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/readings/index.htm">
		                  Readings  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="selected">
			   			<a href="../../../contents/video-lectures/index.htm">
		                  Video Lectures  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/recitations/index.htm">
		                  Recitations  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/assignments/index.htm">
		                  Assignments  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    <li class="">
			   			<a href="../../../contents/exams/index.htm">
		                  Exams  			                
	                    </a>
		        </li>
		    
         	
	
	
	    	
	    	    
		    
         	
	<!--second tal block close-->  
	
</ul>


<!--Left Nav Ends -->





           			</nav>
           			<main id="course_inner_media" aria-labelledby="media_title">
      					 
        <div class="" id="parent-fieldname-text">
            
            
        </div>
    
      					     
    
    



<script type="text/javascript">var caption_embed_1 ={'English - US': '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-7-matching-problems/5RSMLgy06Ew.srt'}</script>     
     <div id="media-embed">
         <div class="attention_message" id="embed_1">
<p>Flash and JavaScript are required for this feature.</p>
<p>Download the video from <a href="http://itunes.apple.com/us/itunes-u/lecture-7-matching-problems/id503873536?i=110644963">iTunes U</a> or the <a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec07_300k.mp4">Internet Archive</a>.</p>
</div>
     </div>
    
     <script type="text/javascript">ocw_embed_chapter_media('embed_1', 'https://www.youtube.com/v/5RSMLgy06Ew', 'youtube', '/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-7-matching-problems', 'https://img.youtube.com/vi/5RSMLgy06Ew/0.jpg',0,0, 'https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-fall-2010/video-lectures/lecture-7-matching-problems/5RSMLgy06Ew.srt')</script>
	 
	 
	 		
	 		<div id="transcript1"></div>
				 <script type="text/javascript">createThreePlayParams(2, 781479, "embed_1", 0, 0)</script>
			 
	

     <div id="media_resource_next_prev_nav" style="margin-top: 1em;">
        <p>
        
            <a href="../../../contents/video-lectures/lecture-6-graph-theory-and-coloring/index.htm">
                <img src="../../../common/images/btn_previous_resource.png" style="margin: 0 30px 0 50px;" alt="Previous track" title="Previous track"></a>
     	
     	
        
            <a href="../../../contents/video-lectures/lecture-8-graph-theory-ii-minimum-spanning-trees/index.htm"> 
                <img src="../../../common/images/btn_next_resource.png" alt="Next track" title="Next track"></a>
       
       </p>
     </div>
 


<script type="text/javascript">
		window.onload=function(){
		init();
		
		}
		var tabLinks = new Array();
		var contentDivs = new Array();
		function init() {
		  // Grab the tab links and content divs from the page
		  var tabListItems = document.getElementById('tabs').childNodes;
		  for ( var i = 0; i < tabListItems.length; i++ ) {
			if ( tabListItems[i].nodeName == "LI" ) {
			  var tabLink = getFirstChildWithTagName( tabListItems[i], 'A' );
			  var id = getHash( tabLink.getAttribute('href') );
			  tabLinks[id] = tabLink;
			  contentDivs[id] = document.getElementById( id );
			}
		  }
		  // Assign onclick events to the tab links, and
		  // highlight the first tab
		  var i = 0;
		  for ( var id in tabLinks ) {
			tabLinks[id].onclick = showTab;
			tabLinks[id].onfocus = function() { this.blur() };
			if ( i == 0 ) tabLinks[id].className = 'selected';
			i++;
		  }
		  // Hide all content divs except the first
		  var i = 0;
		  for ( var id in contentDivs ) {
			if ( i != 0 ) contentDivs[id].className = 'tabContent hide';
			i++;
		  }
		}
		function showTab() {
		  var selectedId = getHash( this.getAttribute('href') );
		  // Highlight the selected tab, and dim all others.
		  // Also show the selected content div, and hide all others.
		  for ( var id in contentDivs ) {
			if ( id == selectedId ) {
			  tabLinks[id].className = 'selected';
			  contentDivs[id].className = 'tabContent';
			} else {
			  tabLinks[id].className = '';
			  contentDivs[id].className = 'tabContent hide';
			}
		  }
		  // Stop the browser following the link
		  return false;
		}
		function getFirstChildWithTagName( element, tagName ) {
		  for ( var i = 0; i < element.childNodes.length; i++ ) {
			if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
		  }
		}
		function getHash( url ) {
		  var hashPos = url.lastIndexOf ( '#' );
		  return url.substring( hashPos + 1 );
		}
 </script>	
 

  <div id="media_tabs">
     
        <ul id="tabs">
            <li class="first">
                <a href="#vid_about" class="selected">About this Video</a>
            </li>
            <li class="">
                <a href="#vid_index" class="">Playlist</a>
            </li>
            <li class="">
                <a href="#vid_playlist" class="">Related Resources</a>
            </li>
            <li class="">
                <a href="#vid_related" class="">Transcript</a>
            </li>
            <li class="">
                <a href="#vid_transcript" class="">Download this Video</a>
            </li>
        </ul>
   
        <div id="vid_about" itemprop="description" class="tabContent">
<p><strong>Description:</strong> Introduces the concept of matching. Discusses the mating algorithm, its fairness, and relation to practical applications.</p> <p><strong>Speaker:</strong> Tom Leighton</p>
</div>
        <div id="vid_index" itemprop="description" class="tabContent hide">
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-1-introduction-and-proofs/index.htm">
<img src="https://img.youtube.com/vi/L3LMbpZIKhQ/default.jpg" title="Lecture 1: Introduction and Proofs" alt="Lecture 1: Introduction and Proofs">
<p>Lecture 1: Introduction and...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-2-induction/index.htm">
<img src="https://img.youtube.com/vi/z8HKWUWS-lA/default.jpg" title="Lecture 2: Induction" alt="Lecture 2: Induction">
<p>Lecture 2: Induction</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-3-strong-induction/index.htm">
<img src="https://img.youtube.com/vi/NuGDkmwEObM/default.jpg" title="Lecture 3: Strong Induction" alt="Lecture 3: Strong Induction">
<p>Lecture 3: Strong Induction</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-4-number-theory-i/index.htm">
<img src="https://img.youtube.com/vi/NuY7szYSXSw/default.jpg" title="Lecture 4: Number Theory I" alt="Lecture 4: Number Theory I">
<p>Lecture 4: Number Theory I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-5-number-theory-ii/index.htm">
<img src="https://img.youtube.com/vi/XX7ePR21Ook/default.jpg" title="Lecture 5: Number Theory II" alt="Lecture 5: Number Theory II">
<p>Lecture 5: Number Theory II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-6-graph-theory-and-coloring/index.htm">
<img src="https://img.youtube.com/vi/h9wxtqoa1jY/default.jpg" title="Lecture 6: Graph Theory and Coloring" alt="Lecture 6: Graph Theory and Coloring">
<p>Lecture 6: Graph Theory and...</p></a>
</div>
<div class="related-media-thumbnail-nolink">
<div class="now-playing-resource">Now Playing</div>
<img src="https://img.youtube.com/vi/5RSMLgy06Ew/default.jpg" title="Lecture 7: Matching Problems" alt="Lecture 7: Matching Problems">
<p>Lecture 7: Matching Problems</p>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-8-graph-theory-ii-minimum-spanning-trees/index.htm">
<img src="https://img.youtube.com/vi/GJpt_3ie4WU/default.jpg" title="Lecture 8: Graph Theory II: Minimum Spanning Trees" alt="Lecture 8: Graph Theory II: Minimum Spanning Trees">
<p>Lecture 8: Graph Theory II:...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-9-communication-networks/index.htm">
<img src="https://img.youtube.com/vi/bTyxpoi2dmM/default.jpg" title="Lecture 9: Communication Networks" alt="Lecture 9: Communication Networks">
<p>Lecture 9: Communication Ne...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-10-graph-theory-iii/index.htm">
<img src="https://img.youtube.com/vi/DOIp5D7VMS4/default.jpg" title="Lecture 10: Graph Theory III" alt="Lecture 10: Graph Theory III">
<p>Lecture 10: Graph Theory III</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-11-relations-partial-orders-and-scheduling/index.htm">
<img src="https://img.youtube.com/vi/1nScXLQAQ9A/default.jpg" title="Lecture 11: Relations, Partial Orders, and Scheduling" alt="Lecture 11: Relations, Partial Orders, and Scheduling">
<p>Lecture 11: Relations, Part...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-12-sums/index.htm">
<img src="https://img.youtube.com/vi/fAeShezAGLE/default.jpg" title="Lecture 12: Sums" alt="Lecture 12: Sums">
<p>Lecture 12: Sums</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-13-sums-and-asymptotics/index.htm">
<img src="https://img.youtube.com/vi/X9eErxRjQEI/default.jpg" title="Lecture 13: Sums and Asymptotics" alt="Lecture 13: Sums and Asymptotics">
<p>Lecture 13: Sums and Asympt...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-14-divide-and-conquer-recurrences/index.htm">
<img src="https://img.youtube.com/vi/Kqf0uO0oV6s/default.jpg" title="Lecture 14: Divide and Conquer Recurrences" alt="Lecture 14: Divide and Conquer Recurrences">
<p>Lecture 14: Divide and Conq...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-15-linear-recurrences/index.htm">
<img src="https://img.youtube.com/vi/TWBB-JlmYUc/default.jpg" title="Lecture 15: Linear Recurrences" alt="Lecture 15: Linear Recurrences">
<p>Lecture 15: Linear Recurrences</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-16-counting-rules-i/index.htm">
<img src="https://img.youtube.com/vi/pNt5Ll6hGqo/default.jpg" title="Lecture 16: Counting Rules I" alt="Lecture 16: Counting Rules I">
<p>Lecture 16: Counting Rules I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-17-counting-rules-ii/index.htm">
<img src="https://img.youtube.com/vi/09yIb3VHhMI/default.jpg" title="Lecture 17: Counting Rules II" alt="Lecture 17: Counting Rules II">
<p>Lecture 17: Counting Rules II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-18-probability-introduction/index.htm">
<img src="https://img.youtube.com/vi/SmFwFdESMHI/default.jpg" title="Lecture 18: Probability Introduction" alt="Lecture 18: Probability Introduction">
<p>Lecture 18: Probability Int...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-19-conditional-probability/index.htm">
<img src="https://img.youtube.com/vi/E6FbvM-FGZ8/default.jpg" title="Lecture 19: Conditional Probability" alt="Lecture 19: Conditional Probability">
<p>Lecture 19: Conditional Pro...</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-20-independence/index.htm">
<img src="https://img.youtube.com/vi/l1BCv3qqW4A/default.jpg" title="Lecture 20: Independence" alt="Lecture 20: Independence">
<p>Lecture 20: Independence</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-21-random-variables/index.htm">
<img src="https://img.youtube.com/vi/MOfhhFaQdjw/default.jpg" title="Lecture 21: Random Variables" alt="Lecture 21: Random Variables">
<p>Lecture 21: Random Variables</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-22-expectation-i/index.htm">
<img src="https://img.youtube.com/vi/gGlMSe7uEkA/default.jpg" title="Lecture 22: Expectation I" alt="Lecture 22: Expectation I">
<p>Lecture 22: Expectation I</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-23-expectation-ii/index.htm">
<img src="https://img.youtube.com/vi/oI9fMUqgfxY/default.jpg" title="Lecture 23: Expectation II" alt="Lecture 23: Expectation II">
<p>Lecture 23: Expectation II</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-24-large-deviations/index.htm">
<img src="https://img.youtube.com/vi/q4mwO2qS2z4/default.jpg" title="Lecture 24: Large Deviations" alt="Lecture 24: Large Deviations">
<p>Lecture 24: Large Deviations</p></a>
</div>
<div class="related-media-thumbnail">
<a href="../../../contents/video-lectures/lecture-25-random-walks/index.htm">
<img src="https://img.youtube.com/vi/56iFMY8QW2k/default.jpg" title="Lecture 25: Random Walks" alt="Lecture 25: Random Walks">
<p>Lecture 25: Random Walks</p></a>
</div>
</div>
        <div id="vid_playlist" itemprop="description" class="tabContent hide">
<h2 class="subhead">Related Resources</h2>
<p>The Mating Algorithm (<a target="_blank" href="../../../contents/video-lectures/lecture-7-matching-problems/MIT6_042JF10_mating.pdf">PDF</a>)</p>
</div>
        <div id="vid_related" itemprop="description" class="tabContent hide">
<ul><li><a class="transcript-link" title="Open in a new window." alt="Open in a new window." style="text-decoration: none; font-size: 1.0em;" target="_blank" text-decoration: none font-size: href="../../../contents/video-lectures/lecture-7-matching-problems/5RSMLgy06Ew.pdf"> Download English-US transcript (PDF)</a></li></ul>
<p><span m="220">The</span> <span m="350">following</span> <span m="790">content</span> <span m="1380">is</span> <span m="1500">provided</span> <span m="1940">under</span> <span m="2220">a</span> <span m="2260">Creative</span> <span m="2660">Commons</span> <span m="3070">license.</span> <span m="4170">Your</span> <span m="4370">support</span> <span m="4870">will</span> <span m="5030">help</span> <span m="5270">MIT</span> <span m="5730">OpenCourseWare</span> <span m="6520">continue</span> <span m="7030">to</span> <span m="7110">offer</span> <span m="7520">high</span> <span m="7760">quality</span> <span m="8280">educational</span> <span m="8910">resources</span> <span m="9530">for</span> <span m="9680">free.</span> <span m="10880">To</span> <span m="10890">make</span> <span m="11100">a</span> <span m="11140">donation</span> <span m="11830">or</span> <span m="12100">view</span> <span m="12530">additional</span> <span m="12960">materials</span> <span m="13500">from</span> <span m="13650">hundreds</span> <span m="14080">of</span> <span m="14190">MIT</span> <span m="14610">courses,</span> <span m="15730">visit</span> <span m="15940">MIT</span> <span m="16370">OpenCourseWare</span> <span m="17410">at</span> <span m="17580">ocw.mit.edu.</span> </p>
<p><span m="23530">PROFESSOR: OK,</span> <span m="25380">on</span> <span m="25590">Tuesday</span> <span m="26770">we</span> <span m="27080">talked</span> <span m="27420">about</span> <span m="27960">sex,</span> <span m="28500">so</span> <span m="29390">today</span> <span m="29790">we're</span> <span m="29940">going</span> <span m="30040">to</span> <span m="30110">talk</span> <span m="30410">about</span> <span m="30890">marriage.</span> <span m="32520">Now,</span> <span m="33060">in</span> <span m="33190">terms</span> <span m="33430">of</span> <span m="33540">graph</span> <span m="33950">theory,</span> <span m="35160">marriage</span> <span m="35770">is</span> <span m="35870">expressed</span> <span m="36580">as</span> <span m="36880">a</span> <span m="37010">matching</span> <span m="37640">problem,</span> <span m="38970">and</span> <span m="39330">today</span> <span m="39720">we're</span> <span m="39890">going</span> <span m="39990">to</span> <span m="40920">talk</span> <span m="41250">about</span> <span m="42140">a</span> <span m="42230">matching</span> <span m="42680">algorithm</span> <span m="43810">that</span> <span m="44070">is</span> <span m="44290">used</span> <span m="44710">in</span> <span m="44790">all</span> <span m="44950">sorts</span> <span m="45200">of</span> <span m="45300">applications.</span> <span m="46070">It's</span> <span m="46230">used</span> <span m="47400">by</span> <span m="47550">online</span> <span m="48020">dating</span> <span m="48390">agencies</span> <span m="49000">to</span> <span m="49280">match</span> <span m="49840">compatible</span> <span m="50350">people</span> <span m="50640">together.</span> </p>
<p><span m="51720">It's</span> <span m="52270">used</span> <span m="52700">for</span> <span m="52830">assignment</span> <span m="53400">problems,</span> <span m="54830">for</span> <span m="54950">example,</span> <span m="55380">matching</span> <span m="55870">interns</span> <span m="56580">to</span> <span m="56650">hospitals</span> <span m="57330">on</span> <span m="57490">match</span> <span m="57840">day.</span> <span m="58900">It's</span> <span m="59220">used</span> <span m="59650">for</span> <span m="59780">resource</span> <span m="60250">allocation</span> <span m="61010">problems,</span> <span m="61630">for</span> <span m="61720">example,</span> <span m="62330">load</span> <span m="62590">balancing</span> <span m="63160">traffic</span> <span m="63640">on</span> <span m="63770">the</span> <span m="63880">internet.</span> <span m="65019">And</span> <span m="65170">we'll</span> <span m="65319">talk</span> <span m="65580">about</span> <span m="65800">the</span> <span m="65930">applications</span> <span m="66570">at</span> <span m="66670">the</span> <span m="66830">end</span> <span m="67050">of</span> <span m="67140">class.</span> </p>
<p><span m="69070">In</span> <span m="69250">its</span> <span m="69410">simplest</span> <span m="70080">form</span> <span m="70710">of</span> <span m="70830">a</span> <span m="70880">matching</span> <span m="71260">problem,</span> <span m="71960">you</span> <span m="72090">have</span> <span m="72290">a</span> <span m="72360">graph</span> <span m="73000">where</span> <span m="73150">the</span> <span m="73350">edges</span> <span m="73870">represent</span> <span m="74470">compatibility.</span> <span m="75690">Two</span> <span m="75900">nodes</span> <span m="76380">can</span> <span m="76540">be</span> <span m="77410">paired</span> <span m="77770">together,</span> <span m="78240">or</span> <span m="78370">married,</span> <span m="79290">and</span> <span m="79510">the</span> <span m="79590">goal</span> <span m="80010">is</span> <span m="80110">to</span> <span m="80200">create</span> <span m="80730">the</span> <span m="80870">maximum</span> <span m="81650">number</span> <span m="82140">of</span> <span m="82350">compatible</span> <span m="83000">pairs.</span> <span m="84470">So</span> <span m="85730">let's</span> <span m="85960">define</span> <span m="86460">a</span> <span m="86520">matching,</span> <span m="91800">given</span> <span m="92040">a</span> <span m="92100">graph,</span> <span m="94440">G,</span> <span m="96090">with</span> <span m="96300">nodes,</span> <span m="96830">V,</span> <span m="97150">and</span> <span m="97240">edges,</span> <span m="97600">E.</span> <span m="99930">In</span> <span m="100130">matching,</span> <span m="105830">you</span> <span m="105970">can</span> <span m="106100">think</span> <span m="106310">of</span> <span m="106420">it</span> <span m="106500">as</span> <span m="106740">a</span> <span m="106830">collection</span> <span m="107340">of</span> <span m="107440">edges,</span> <span m="107900">or</span> <span m="108180">a</span> <span m="108710">subgraph</span> <span m="111840">of</span> <span m="111940">G</span> <span m="115780">where</span> <span m="116080">every</span> <span m="116420">node</span> <span m="116820">has</span> <span m="117070">degree</span> <span m="117420">1.</span> <span m="118220">So</span> <span m="118580">everybody</span> <span m="119030">can</span> <span m="119140">be</span> <span m="119260">married</span> <span m="119690">just</span> <span m="120030">to</span> <span m="120100">one</span> <span m="120290">person.</span> </p>
<p><span m="133960">So</span> <span m="134370">let's</span> <span m="134740">draw</span> <span m="135040">an</span> <span m="135120">example,</span> <span m="155274">maybe not put</span> <span m="155770">that</span> <span m="155960">edge</span> <span m="156250">in.</span> <span m="160752">And</span> <span m="161220">let's</span> <span m="161440">label</span> <span m="161720">these</span> <span m="161940">nodes</span> <span m="162490">x1,</span> <span m="163302">x2,</span> <span m="164940">x3,</span> <span m="166940">x4,</span> <span m="168270">x5,</span> <span m="169506">x6,</span> <span m="170500">x7,</span> <span m="171360">and</span> <span m="171520">x8.</span> <span m="174170">Now</span> <span m="175400">x1, x6</span> <span m="178150">and</span> <span m="179140">x2, x5</span> <span m="180730">is</span> <span m="180940">a</span> <span m="181000">matching,</span> <span m="183310">so</span> <span m="183550">x1, x6</span> <span m="185940">and</span> <span m="186410">x2, x5</span> <span m="189850">is</span> <span m="190120">a</span> <span m="190250">matching</span> <span m="191060">with</span> <span m="191270">two</span> <span m="191550">edges,</span> <span m="192060">so</span> <span m="192100">we</span> <span m="192220">say</span> <span m="192500">it</span> <span m="192580">has</span> <span m="192810">size</span> <span m="193230">two.</span> </p>
<p><span m="199930">All</span> <span m="200060">right,</span> <span m="200230">so</span> <span m="200310">I</span> <span m="200350">can pair</span> <span m="201080">these</span> <span m="201370">guys</span> <span m="201640">up</span> <span m="201830">and pair</span> <span m="202190">these</span> <span m="202460">guys</span> <span m="202740">up.</span> <span m="204990">Is</span> <span m="205140">there</span> <span m="205280">any</span> <span m="205480">bigger</span> <span m="205840">matching</span> <span m="206350">in</span> <span m="206440">this</span> <span m="206610">graph?</span> <span m="211420">So</span> <span m="211440">I</span> <span m="211530">found</span> <span m="211920">one</span> <span m="212180">with</span> <span m="212560">two</span> <span m="212770">marriages,</span> <span m="213640">here</span> <span m="214270">and</span> <span m="214380">here,</span> <span m="214700">two</span> <span m="214940">edges.</span> <span m="215860">Yeah?</span> </p>
<p><span m="216844">AUDIENCE: x1, x7.</span> </p>
<p><span m="218320">PROFESSOR: x1, x7.</span> </p>
<p><span m="220140">AUDIENCE: x2, x6.</span> </p>
<p><span m="221670">PROFESSOR: x2, x6.</span> </p>
<p><span m="222990">AUDIENCE:</span> <span m="223483">[INAUDIBLE].</span> </p>
<p><span m="224470">PROFESSOR: Good.</span> <span m="224710">All</span> <span m="224820">right,</span> <span m="224970">that's</span> <span m="225430">a</span> <span m="225530">matching</span> <span m="226190">of</span> <span m="226340">size</span> <span m="226870">three.</span> <span m="227330">So</span> <span m="227480">I</span> <span m="227560">got</span> <span m="227900">three</span> <span m="228440">couples</span> <span m="228870">together.</span> <span m="229840">Good.</span> <span m="231790">Can</span> <span m="231950">I</span> <span m="232010">make</span> <span m="232250">a</span> <span m="232300">bigger</span> <span m="232560">matching,</span> <span m="235210">one</span> <span m="235500">with</span> <span m="235790">size</span> <span m="236400">four--</span> <span m="238168">four</span> <span m="238610">marriages</span> <span m="239130">here?</span> <span m="243000">No.</span> <span m="244130">Why</span> <span m="244720">not?</span> <span m="245030">Can</span> <span m="245140">anybody</span> <span m="245500">give</span> <span m="245660">me</span> <span m="245820">a</span> <span m="245880">reason</span> <span m="246280">why</span> <span m="246870">it</span> <span m="246970">can't</span> <span m="247140">be</span> <span m="247250">done?</span> <span m="252480">Yeah?</span> </p>
<p><span m="254074">AUDIENCE: x8</span> <span m="254551">and x7</span> <span m="255028">would</span> <span m="255505">have</span> <span m="255982">to</span> <span m="257413">be</span> <span m="258367">matched</span> <span m="258844">with</span> <span m="259329">someone.</span> </p>
<p><span m="260810">PROFESSOR: Yeah,</span> <span m="261220">so</span> <span m="261399">if--</span> <span m="262310">Yeah?</span> </p>
<p><span m="262460">AUDIENCE: They could only</span> <span m="262863">be paired with</span> <span m="263266">x1,</span> <span m="264290">but x1</span> <span m="264760">can't be</span> <span m="265040">paired with</span> <span m="265500">both.</span> </p>
<p><span m="266110">PROFESSOR: Good.</span> <span m="266490">If</span> <span m="266670">I</span> <span m="266750">were</span> <span m="266880">to</span> <span m="266970">have</span> <span m="267310">a</span> <span m="267380">matching</span> <span m="267890">with</span> <span m="268450">four</span> <span m="268850">edges,</span> <span m="270080">well,</span> <span m="270190">there's</span> <span m="270350">only</span> <span m="270650">eight</span> <span m="270880">nodes,</span> <span m="271990">so</span> <span m="272120">I'd</span> <span m="272250">have</span> <span m="272500">to</span> <span m="272620">have</span> <span m="272980">all</span> <span m="273220">eight</span> <span m="273450">nodes</span> <span m="273750">involved</span> <span m="274180">in</span> <span m="274240">the</span> <span m="274310">matching.</span> <span m="275800">And</span> <span m="276350">that</span> <span m="276500">means</span> <span m="276840">x7</span> <span m="277010">and</span> <span m="277280">x8</span> <span m="277900">would</span> <span m="278010">have</span> <span m="278200">to</span> <span m="278300">be</span> <span m="278390">in</span> <span m="278460">the</span> <span m="278530">matching,</span> <span m="278920">but</span> <span m="279050">they</span> <span m="279220">could</span> <span m="279390">only</span> <span m="279700">be</span> <span m="279890">paired</span> <span m="280260">with</span> <span m="280390">x1,</span> <span m="281930">and</span> <span m="282140">so</span> <span m="282330">it's</span> <span m="282420">not</span> <span m="282690">possible</span> <span m="283550">to</span> <span m="283860">do</span> <span m="284030">that.</span> <span m="285140">All</span> <span m="285260">right,</span> <span m="285420">so</span> <span m="285520">there</span> <span m="285680">is</span> <span m="285920">no</span> <span m="286070">matching</span> <span m="286470">of</span> <span m="286550">size</span> <span m="286910">four in</span> <span m="287230">this</span> <span m="287470">graph.</span> <span m="287810">Three</span> <span m="288040">is</span> <span m="288160">the</span> <span m="288240">best</span> <span m="288520">I</span> <span m="288570">can</span> <span m="288760">do.</span> </p>
<p><span m="290310">Now,</span> <span m="290840">when</span> <span m="291020">you</span> <span m="291120">get</span> <span m="291350">every</span> <span m="291810">node</span> <span m="292410">in</span> <span m="292570">a</span> <span m="292610">matching,</span> <span m="293690">then</span> <span m="293870">it's</span> <span m="294030">called</span> <span m="294450">a</span> <span m="294540">perfect</span> <span m="295250">matching.</span> <span m="296460">And</span> <span m="296610">so</span> <span m="296810">in</span> <span m="296900">this</span> <span m="297090">case,</span> <span m="297560">it</span> <span m="297580">doesn't</span> <span m="297860">exist,</span> <span m="298480">but</span> <span m="298530">sometimes</span> <span m="299010">it</span> <span m="299100">does.</span> <span m="305010">So</span> <span m="305240">a</span> <span m="305310">matching</span> <span m="308560">is</span> <span m="308840">perfect</span> <span m="314770">if</span> <span m="315040">it</span> <span m="315200">has</span> <span m="315460">size</span> <span m="319220">half</span> <span m="319710">the</span> <span m="319850">number</span> <span m="320110">of</span> <span m="320240">nodes.</span> <span m="321780">In</span> <span m="321890">other</span> <span m="322030">words,</span> <span m="322200">if the</span> <span m="322370">number</span> <span m="322640">of</span> <span m="322730">edges</span> <span m="323190">is</span> <span m="323440">v</span> <span m="323640">over</span> <span m="323830">2,</span> <span m="324050">then</span> <span m="324240">every</span> <span m="324530">node</span> <span m="324810">is</span> <span m="324950">in</span> <span m="325200">the</span> <span m="325280">matching.</span> </p>
<p><span m="329640">All</span> <span m="329800">right,</span> <span m="330010">so</span> <span m="330110">that</span> <span m="330340">one</span> <span m="330480">doesn't</span> <span m="330730">have</span> <span m="330850">a</span> <span m="330910">perfect</span> <span m="331260">matching.</span> <span m="331680">What</span> <span m="331810">about</span> <span m="332070">this</span> <span m="332270">graph?</span> <span m="336270">So</span> <span m="336390">I</span> <span m="336440">got</span> <span m="336610">b1,</span> <span m="337310">b2,</span> <span m="338110">b3,</span> <span m="338900">b4,</span> <span m="343640">g1,</span> <span m="344800">g2,</span> <span m="345820">g3,</span> <span m="347380">g4,</span> <span m="347740">and</span> <span m="347800">I'll</span> <span m="347910">put</span> <span m="348080">in</span> <span m="348140">the</span> <span m="348220">compatibility</span> <span m="349050">edges</span> <span m="349350">here.</span> </p>
<p><span m="364510">OK,</span> <span m="365990">Does</span> <span m="366680">that</span> <span m="366960">graph</span> <span m="367600">have</span> <span m="367990">a</span> <span m="368140">perfect</span> <span m="368950">matching?</span> <span m="371040">Can</span> <span m="371210">you</span> <span m="371350">pair</span> <span m="371750">up</span> <span m="371880">every</span> <span m="372120">boy</span> <span m="372630">with</span> <span m="372860">a</span> <span m="372920">girl</span> <span m="373360">here</span> <span m="374350">so that</span> <span m="374570">everybody is</span> <span m="375890">compatible</span> <span m="376470">with</span> <span m="376610">their</span> <span m="376760">mate,</span> <span m="377610">and</span> <span m="377720">you</span> <span m="377780">have</span> <span m="377950">just</span> <span m="378130">one</span> <span m="378360">spouse?</span> <span m="380948">Can you</span> <span m="381440">do</span> <span m="381590">that?</span> </p>
<p><span m="384815">AUDIENCE: Yes.</span> </p>
<p><span m="385300">PROFESSOR: Yeah?</span> <span m="385565">All</span> <span m="385830">right, who</span> <span m="386310">do</span> <span m="386480">I</span> <span m="386560">start</span> <span m="386820">pairing</span> <span m="387160">up?</span> </p>
<p><span m="387730">AUDIENCE: 1, 1.</span> </p>
<p><span m="389350">AUDIENCE: 1, 1.</span> </p>
<p><span m="392130">AUDIENCE: b2, g3.</span> </p>
<p><span m="393460">PROFESSOR: b2, g3.</span> </p>
<p><span m="397036">AUDIENCE: b3, g2.</span> </p>
<p><span m="397470">PROFESSOR: b3, g2</span> </p>
<p><span m="399642">AUDIENCE: b4, g4.</span> </p>
<p><span m="400090">PROFESSOR: There</span> <span m="400430">we</span> <span m="400540">go.</span> <span m="400900">All</span> <span m="401040">right,</span> <span m="401330">so</span> <span m="401420">there</span> <span m="401600">is</span> <span m="401850">a</span> <span m="401920">perfect</span> <span m="402320">matching</span> <span m="402750">in</span> <span m="402830">this</span> <span m="403030">graph.</span> <span m="404100">Very</span> <span m="404340">good.</span> </p>
<p><span m="407000">Now,</span> <span m="407720">in</span> <span m="407880">some</span> <span m="408200">cases,</span> <span m="409870">some</span> <span m="410280">pairings</span> <span m="410790">are</span> <span m="410840">more</span> <span m="411120">desirable</span> <span m="411670">than</span> <span m="411800">others,</span> <span m="413100">and</span> <span m="413270">this</span> <span m="413440">can</span> <span m="413560">be</span> <span m="413670">represented</span> <span m="414280">with</span> <span m="414440">a</span> <span m="414520">weight.</span> <span m="415470">And</span> <span m="415650">so</span> <span m="415730">you</span> <span m="415800">might</span> <span m="415980">have</span> <span m="416130">a</span> <span m="416210">weighted</span> <span m="416630">graph</span> <span m="417010">where</span> <span m="417180">every</span> <span m="417580">edge</span> <span m="417960">has</span> <span m="418160">a</span> <span m="418230">weight</span> <span m="418520">on</span> <span m="418720">it.</span> <span m="420400">For</span> <span m="420590">example,</span> <span m="422150">we</span> <span m="422190">might</span> <span m="422480">weight</span> <span m="422960">b1, g2</span> <span m="425620">with</span> <span m="425830">5,</span> <span m="427510">and</span> <span m="428420">b1, g1</span> <span m="429560">gets</span> <span m="429760">a</span> <span m="429850">10.</span> </p>
<p><span m="431170">And</span> <span m="431380">usually</span> <span m="431910">when</span> <span m="432040">you</span> <span m="432120">see</span> <span m="432370">weighted</span> <span m="432830">graphs</span> <span m="433290">in</span> <span m="433350">the</span> <span m="433420">matching</span> <span m="433820">context,</span> <span m="434840">a</span> <span m="434950">lower</span> <span m="435430">weight</span> <span m="435910">means</span> <span m="436200">it's</span> <span m="436370">more</span> <span m="436670">desirable,</span> <span m="438600">so</span> <span m="438650">that</span> <span m="439050">b1</span> <span m="439740">and</span> <span m="439860">g2</span> <span m="440380">would</span> <span m="440530">get</span> <span m="440650">along</span> <span m="441000">better</span> <span m="441410">than</span> <span m="441620">b1</span> <span m="442110">and</span> <span m="442360">g1.</span> <span m="444510">And</span> <span m="444710">then</span> <span m="444970">the</span> <span m="445050">goal</span> <span m="445380">is</span> <span m="445480">to</span> <span m="445590">find</span> <span m="446270">a</span> <span m="446370">matching</span> <span m="446870">with</span> <span m="447020">minimum</span> <span m="447480">weight.</span> </p>
<p><span m="452270">Now,</span> <span m="452560">the</span> <span m="452690">weight</span> <span m="453770">of</span> <span m="453920">a</span> <span m="453980">matching,</span> <span m="462560">call</span> <span m="462850">it</span> <span m="462910">M,</span> <span m="464740">is</span> <span m="465320">the</span> <span m="465590">sum</span> <span m="468720">of</span> <span m="469190">the</span> <span m="469290">weights</span> <span m="469670">on</span> <span m="469780">the</span> <span m="469920">edges</span> <span m="470190">of</span> <span m="470320">M.</span> <span m="481280">Now,</span> <span m="481400">usually</span> <span m="481940">when</span> <span m="482090">you're</span> <span m="482440">looking</span> <span m="482790">at</span> <span m="482920">weighted</span> <span m="483420">matchings,</span> <span m="483940">you</span> <span m="484180">require</span> <span m="485390">yourself</span> <span m="485760">to</span> <span m="485840">have</span> <span m="486040">a</span> <span m="486130">perfect</span> <span m="486850">matching</span> <span m="487970">so</span> <span m="488130">that</span> <span m="488260">everybody</span> <span m="488740">gets</span> <span m="488940">paired</span> <span m="489250">up.</span> <span m="489930">And</span> <span m="490740">often</span> <span m="491130">in that</span> <span m="491320">case,</span> <span m="491510">you'll</span> <span m="491720">see</span> <span m="491980">all</span> <span m="492360">the</span> <span m="492510">edges</span> <span m="492860">present,</span> <span m="493830">some</span> <span m="494110">of</span> <span m="494160">them</span> <span m="494310">with</span> <span m="494430">very</span> <span m="494800">big</span> <span m="495020">weights,</span> <span m="495440">maybe</span> <span m="495830">even</span> <span m="496010">infinity</span> <span m="496920">if</span> <span m="497060">they</span> <span m="497160">just</span> <span m="497400">can't</span> <span m="497640">be</span> <span m="497750">put</span> <span m="497960">together.</span> <span m="498860">Because</span> <span m="499030">otherwise</span> <span m="499440">you</span> <span m="499530">just</span> <span m="499690">say,</span> <span m="499920">don't</span> <span m="500640">match</span> <span m="501020">anybody</span> <span m="501430">together,</span> <span m="501720">and</span> <span m="501780">you</span> <span m="501850">have</span> <span m="501970">weight</span> <span m="502210">zero.</span> </p>
<p><span m="502580">So</span> <span m="502820">for</span> <span m="503040">when</span> <span m="503140">you</span> <span m="503290">look</span> <span m="503490">at</span> <span m="503940">minimum</span> <span m="504400">weight</span> <span m="504690">matchings,</span> <span m="505800">you're</span> <span m="505910">looking</span> <span m="506220">for</span> <span m="506320">the</span> <span m="506460">perfect</span> <span m="506950">matching</span> <span m="507360">with</span> <span m="507520">minimum</span> <span m="507890">weight.</span> <span m="512450">So</span> <span m="512559">we</span> <span m="512679">say</span> <span m="512840">a</span> <span m="512900">min-weight</span> <span m="513570">matching</span> <span m="524990">for a</span> <span m="525220">graph,</span> <span m="525590">G,</span> <span m="527180">is</span> <span m="527520">a</span> <span m="527810">perfect</span> <span m="528370">matching</span> <span m="537030">for</span> <span m="537150">G</span> <span m="538250">with</span> <span m="538490">the</span> <span m="538580">minimum</span> <span m="538960">weight,</span> <span m="539410">overall</span> <span m="539840">perfect</span> <span m="540200">matchings.</span> <span m="548560">Let's</span> <span m="549030">try an</span> <span m="549350">example.</span> </p>
<p><span m="554140">Say</span> <span m="554370">I've</span> <span m="554460">got</span> <span m="554670">this</span> <span m="554940">graph,</span> <span m="557290">and</span> <span m="558510">call</span> <span m="558780">this</span> <span m="559780">node</span> <span m="560060">Brad,</span> <span m="561780">here's</span> <span m="562100">Billy</span> <span m="562400">Bob,</span> <span m="564660">here's</span> <span m="565160">Jennifer,</span> <span m="567990">and then</span> <span m="568280">Angelina.</span> <span m="572320">And</span> <span m="572590">the</span> <span m="572680">weights</span> <span m="573050">are</span> <span m="573120">as</span> <span m="573250">follows--</span> <span m="573770">I</span> <span m="573830">put</span> <span m="574020">a</span> <span m="574110">10</span> <span m="574440">here,</span> <span m="574870">a</span> <span m="574980">10</span> <span m="575220">down</span> <span m="575550">here,</span> <span m="576590">a</span> <span m="576670">5</span> <span m="577210">here,</span> <span m="577480">because</span> <span m="577680">Brad</span> <span m="578060">really</span> <span m="578710">likes</span> <span m="579020">Angelina</span> <span m="579560">and</span> <span m="579680">vice</span> <span m="579940">versa,</span> <span m="580980">and</span> <span m="581140">a</span> <span m="581210">16</span> <span m="582000">between</span> <span m="582340">Jennifer</span> <span m="582790">and</span> <span m="582890">Billy</span> <span m="583140">Bob.</span> <span m="585070">What</span> <span m="585470">is</span> <span m="585720">the</span> <span m="585850">weight</span> <span m="586460">of</span> <span m="586580">the</span> <span m="586670">min</span> <span m="587160">weight</span> <span m="587490">matching</span> <span m="588050">in</span> <span m="588200">that</span> <span m="588480">graph?</span> <span m="590980">20.</span> <span m="592080">And</span> <span m="593160">who</span> <span m="593370">gets</span> <span m="593610">paired</span> <span m="593940">with</span> <span m="594090">who</span> <span m="594320">there?</span> <span m="597680">Who</span> <span m="597830">does</span> <span m="597980">Brad</span> <span m="598350">get</span> <span m="598490">hooked</span> <span m="598740">up</span> <span m="598900">with?</span> </p>
<p><span m="599710">AUDIENCE:</span> <span m="600210">Jan.</span> </p>
<p><span m="601210">PROFESSOR: Jan,</span> <span m="602300">and</span> <span m="602540">that</span> <span m="602740">leaves</span> <span m="603010">Billy</span> <span m="603340">Bob</span> <span m="604810">with</span> <span m="605060">Angelina,</span> <span m="608480">and</span> <span m="608770">the</span> <span m="608860">weight</span> <span m="609860">is</span> <span m="610070">20.</span> <span m="611030">So</span> <span m="611210">even</span> <span m="611500">though</span> <span m="611660">Brad</span> <span m="612050">really</span> <span m="612440">likes</span> <span m="612730">Angelina,</span> <span m="614500">if</span> <span m="614690">I</span> <span m="614770">go</span> <span m="615000">that</span> <span m="615270">route,</span> <span m="615700">my</span> <span m="615840">weight</span> <span m="616110">is</span> <span m="616230">21,</span> <span m="616990">which</span> <span m="617060">is</span> <span m="617180">not</span> <span m="617400">as</span> <span m="617520">good.</span> <span m="618730">So</span> <span m="618850">the</span> <span m="618950">min-weight</span> <span m="619440">matching</span> <span m="620540">would</span> <span m="620690">be</span> <span m="620820">this</span> <span m="621040">one.</span> </p>
<p><span m="624340">OK.</span> <span m="624620">Now,</span> <span m="625150">it</span> <span m="625310">turns</span> <span m="625650">out</span> <span m="626750">that</span> <span m="627100">finding</span> <span m="627760">the</span> <span m="627860">maximum</span> <span m="628430">matching--</span> <span m="628890">the</span> <span m="628970">maximum</span> <span m="629370">number</span> <span m="629580">of</span> <span m="629650">edges</span> <span m="629880">you</span> <span m="630000">can</span> <span m="630100">put</span> <span m="630270">together--</span> <span m="631580">or</span> <span m="631850">finding</span> <span m="632410">the</span> <span m="632550">minimum</span> <span m="633170">weight</span> <span m="633590">perfect</span> <span m="634090">matching,</span> <span m="635580">those</span> <span m="635900">are</span> <span m="635960">both</span> <span m="636220">solvable,</span> <span m="636800">tractable</span> <span m="637320">problems.</span> <span m="638110">You</span> <span m="638220">don't</span> <span m="638410">get</span> <span m="638530">a</span> <span m="638580">million</span> <span m="638900">dollar</span> <span m="639160">prize</span> <span m="640130">for</span> <span m="640290">solving</span> <span m="640660">that.</span> <span m="641910">The</span> <span m="642190">algorithm is</span> <span m="642680">run</span> <span m="643090">in</span> <span m="643830">quadratic</span> <span m="644470">to</span> <span m="644580">cubic</span> <span m="644930">time,</span> <span m="645440">so</span> <span m="645780">not</span> <span m="646110">terrible,</span> <span m="647990">but</span> <span m="648180">they're</span> <span m="648280">not</span> <span m="648500">NP-complete,</span> <span m="649330">so</span> <span m="649500">people</span> <span m="649780">know</span> <span m="649870">how</span> <span m="650040">to</span> <span m="650160">do</span> <span m="650360">it.</span> </p>
<p><span m="650720">Now,</span> <span m="650860">they</span> <span m="651000">are</span> <span m="651300">pretty</span> <span m="651570">complicated,</span> <span m="652790">so</span> <span m="652860">we're</span> <span m="652940">not</span> <span m="653120">going</span> <span m="653220">to</span> <span m="653280">cover</span> <span m="653570">them in</span> <span m="653720">6042.</span> <span m="655310">What</span> <span m="655540">we're</span> <span m="655680">going</span> <span m="655780">to</span> <span m="655860">do</span> <span m="656120">is</span> <span m="656270">look</span> <span m="656440">at</span> <span m="656500">a</span> <span m="656550">slightly</span> <span m="657130">different</span> <span m="657790">version</span> <span m="658180">of</span> <span m="658230">the</span> <span m="658320">problem</span> <span m="659340">that</span> <span m="659460">actually</span> <span m="660250">turns</span> <span m="660480">out</span> <span m="660570">to</span> <span m="660640">be</span> <span m="660710">more</span> <span m="660950">useful</span> <span m="661320">in</span> <span m="661370">practice,</span> <span m="661880">because</span> <span m="662180">there's</span> <span m="662330">a</span> <span m="662390">very</span> <span m="662790">nice</span> <span m="663100">algorithm</span> <span m="663520">for</span> <span m="663810">it.</span> <span m="664970">Now,</span> <span m="665600">in</span> <span m="665740">the</span> <span m="665830">version</span> <span m="666230">of</span> <span m="666270">the</span> <span m="666350">problem</span> <span m="666660">that</span> <span m="666760">we're</span> <span m="666980">going</span> <span m="667090">to</span> <span m="667150">look</span> <span m="667410">at,</span> <span m="668920">everybody</span> <span m="669730">has</span> <span m="670110">preferences--</span> <span m="671040">a</span> <span m="671110">preference</span> <span m="671720">list.</span> <span m="672560">It's</span> <span m="672770">not</span> <span m="673080">weighted,</span> <span m="674010">but</span> <span m="674110">it's</span> <span m="674310">a</span> <span m="674380">priority</span> <span m="675020">order</span> <span m="675490">of</span> <span m="675630">who</span> <span m="675870">they</span> <span m="676020">want</span> <span m="676270">to</span> <span m="676310">get</span> <span m="676870">mated</span> <span m="677100">to,</span> <span m="677720">or</span> <span m="677850">matched</span> <span m="678180">up</span> <span m="678360">with.</span> </p>
<p><span m="679540">So</span> <span m="679830">it</span> <span m="679930">would</span> <span m="680060">look</span> <span m="680400">not</span> <span m="680830">quite</span> <span m="681210">like</span> <span m="681420">that,</span> <span m="681740">but</span> <span m="681830">it</span> <span m="681870">would</span> <span m="681990">look</span> <span m="682190">like</span> <span m="682380">this.</span> <span m="688630">So</span> <span m="688900">Brad,</span> <span m="690760">Billy</span> <span m="691030">Bob,</span> <span m="694530">Jennifer,</span> <span m="696260">and</span> <span m="696420">Angelina--</span> <span m="697650">same</span> <span m="697980">players,</span> <span m="700480">but</span> <span m="700660">what</span> <span m="700790">we</span> <span m="700930">do</span> <span m="701330">is</span> <span m="701430">we</span> <span m="701560">know</span> <span m="701890">that</span> <span m="702420">Brad</span> <span m="702950">really</span> <span m="703430">likes</span> <span m="703760">Angelina,</span> <span m="705050">and</span> <span m="705270">Angelina</span> <span m="705800">really</span> <span m="706040">likes</span> <span m="706320">Brad,</span> <span m="706770">so</span> <span m="706860">they are</span> <span m="707080">first</span> <span m="707400">choices,</span> <span m="708440">at least</span> <span m="709590">was.</span> <span m="710660">Number</span> <span m="710930">two</span> <span m="711180">for</span> <span m="711310">Brad</span> <span m="711660">is</span> <span m="711780">Jennifer,</span> <span m="712610">but</span> <span m="713090">Jennifer</span> <span m="713780">really</span> <span m="714270">likes</span> <span m="714600">Brad</span> <span m="714990">first,</span> <span m="716140">and</span> <span m="716330">Billy</span> <span m="716580">Bob</span> <span m="716830">second.</span> <span m="717900">Billy</span> <span m="718190">Bob</span> <span m="718970">likes</span> <span m="719270">Angelina</span> <span m="720330">first,</span> <span m="720890">then</span> <span m="721120">Jennifer.</span> <span m="722200">Angelina</span> <span m="722840">thinks</span> <span m="723150">Billy</span> <span m="723490">Bob</span> <span m="723770">is</span> <span m="723890">number</span> <span m="724130">two.</span> </p>
<p><span m="725370">So</span> <span m="725600">it's</span> <span m="726360">not</span> <span m="726720">necessarily</span> <span m="727300">symmetric.</span> <span m="728740">Jennifer</span> <span m="729210">has</span> <span m="729460">Brad</span> <span m="729760">as</span> <span m="729860">the</span> <span m="729940">first</span> <span m="730230">choice.</span> <span m="730720">Brad</span> <span m="731070">has</span> <span m="731310">Angelina</span> <span m="731650">as</span> <span m="731990">the</span> <span m="732090">first</span> <span m="732370">choice.</span> <span m="733502">All right?</span> <span m="733850">So</span> <span m="733980">it's</span> <span m="734090">an</span> <span m="734190">asymmetric</span> <span m="734710">situation.</span> </p>
<p><span m="737420">Now,</span> <span m="737940">what</span> <span m="738230">would</span> <span m="738370">happen</span> <span m="739540">if</span> <span m="739680">we</span> <span m="739790">set</span> <span m="740050">up</span> <span m="740200">our</span> <span m="740350">marriages</span> <span m="740990">so</span> <span m="741130">that</span> <span m="741750">Brad is</span> <span m="742170">married</span> <span m="742540">to</span> <span m="742600">Jen,</span> <span m="743770">and</span> <span m="743980">Billy</span> <span m="744250">Bob</span> <span m="744580">is</span> <span m="744680">married</span> <span m="744960">to</span> <span m="745020">Angelina?</span> <span m="748280">What</span> <span m="748530">might</span> <span m="748750">happen</span> <span m="749120">if</span> <span m="749210">we</span> <span m="749300">made</span> <span m="749590">those</span> <span m="749900">as</span> <span m="750040">our</span> <span m="750310">pairings,</span> <span m="750970">and</span> <span m="751400">we</span> <span m="751600">put</span> <span m="751770">them</span> <span m="751890">on</span> <span m="752010">a</span> <span m="752070">desert</span> <span m="752430">island,</span> <span m="752790">all</span> <span m="752940">four</span> <span m="753250">of them?</span> <span m="753420">What's</span> <span m="753970">likely</span> <span m="754250">to</span> <span m="754310">happen</span> <span m="754640">there?</span> </p>
<p><span m="757270">AUDIENCE: Brad and</span> <span m="757750">Angelina</span> <span m="758230">are going to cheat on each other.</span> </p>
<p><span m="759010">PROFESSOR: Yeah,</span> <span m="759700">we're</span> <span m="759830">going</span> <span m="759920">to</span> <span m="759960">have</span> <span m="760120">a</span> <span m="760190">problem.</span> <span m="761220">Because</span> <span m="761530">Brad</span> <span m="761850">and</span> <span m="761930">Angelina</span> <span m="762430">have</span> <span m="762630">the</span> <span m="762710">hots</span> <span m="763060">for</span> <span m="763190">each</span> <span m="763360">other</span> <span m="763560">here,</span> <span m="764680">and</span> <span m="765190">they</span> <span m="765330">like</span> <span m="765650">each other</span> <span m="765880">better</span> <span m="766010">than</span> <span m="766490">their</span> <span m="766630">spouse.</span> <span m="768100">So</span> <span m="768300">before</span> <span m="768660">you</span> <span m="768760">know</span> <span m="768930">it,</span> <span m="769100">they're</span> <span m="769250">going</span> <span m="769360">to</span> <span m="769410">be</span> <span m="769530">doing</span> <span m="769780">their</span> <span m="769980">6042</span> <span m="770720">homework</span> <span m="771070">together</span> <span m="771540">late</span> <span m="771750">at</span> <span m="771950">night.</span> <span m="773869">All</span> <span m="774302">right?</span> <span m="775170">Now,</span> <span m="775430">when</span> <span m="775550">this</span> <span m="775750">happens,</span> <span m="776280">we</span> <span m="776420">have</span> <span m="776650">what's</span> <span m="776830">called</span> <span m="777200">a</span> <span m="777320">rogue</span> <span m="778040">couple.</span> </p>
<p><span m="785380">Given</span> <span m="785680">a</span> <span m="785760">matching,</span> <span m="792110">x</span> <span m="792520">and</span> <span m="792720">y,</span> <span m="794040">a</span> <span m="794180">boy</span> <span m="794320">and</span> <span m="794460">a</span> <span m="794500">girl,</span> <span m="794880">say,</span> <span m="797740">form a</span> <span m="798170">rogue</span> <span m="798550">couple</span> <span m="810670">if</span> <span m="811500">they</span> <span m="812590">prefer</span> <span m="813510">each</span> <span m="813810">other</span> <span m="819640">over</span> <span m="820020">their</span> <span m="820210">mates</span> <span m="827280">in</span> <span m="827510">M.</span> <span m="832880">All</span> <span m="833250">right.</span> <span m="833470">So</span> <span m="833610">here,</span> <span m="833960">if we</span> <span m="834130">married</span> <span m="834470">Brad to</span> <span m="834870">Jennifer,</span> <span m="836140">and</span> <span m="836280">Billy</span> <span m="836540">Bob to</span> <span m="836830">Angelina,</span> <span m="837760">Brad</span> <span m="838190">and</span> <span m="838300">Angelina</span> <span m="838860">form a</span> <span m="839210">rogue</span> <span m="839590">couple,</span> <span m="840000">because</span> <span m="840170">they</span> <span m="840280">like</span> <span m="840550">each</span> <span m="840760">other</span> <span m="841040">better</span> <span m="841300">than</span> <span m="841450">who</span> <span m="841600">they</span> <span m="841780">were</span> <span m="842420">hooked</span> <span m="842670">up</span> <span m="842840">with.</span> <span m="843810">And</span> <span m="843960">that's</span> <span m="844150">sort</span> <span m="844310">of</span> <span m="844380">a</span> <span m="844450">bad</span> <span m="844800">thing.</span> <span m="845050">It</span> <span m="845330">creates</span> <span m="845800">instability</span> <span m="847470">if</span> <span m="847600">you</span> <span m="847760">were</span> <span m="847810">to</span> <span m="847870">make</span> <span m="848080">the</span> <span m="848160">matchings</span> <span m="848590">that</span> <span m="848790">way.</span> <span m="850530">In</span> <span m="850610">fact,</span> <span m="850970">we</span> <span m="851080">say</span> <span m="851380">that</span> <span m="851510">a</span> <span m="851550">matching</span> <span m="851970">is</span> <span m="852060">stable</span> <span m="865240">if</span> <span m="866070">there</span> <span m="866350">aren't</span> <span m="866750">any</span> <span m="867610">rogue</span> <span m="867940">couples.</span> </p>
<p><span m="878890">And</span> <span m="880020">now,</span> <span m="880480">one</span> <span m="880680">thing</span> <span m="880800">to</span> <span m="880850">make</span> <span m="881020">clear</span> <span m="881940">is</span> <span m="882220">that</span> <span m="882430">your</span> <span m="882580">preferences</span> <span m="883410">can't</span> <span m="883740">change</span> <span m="884120">over</span> <span m="884310">time.</span> <span m="885330">So</span> <span m="885460">it's</span> <span m="885570">not</span> <span m="885760">a</span> <span m="885810">situation</span> <span m="886440">where</span> <span m="886540">you</span> <span m="886660">get</span> <span m="886880">bored</span> <span m="887170">with</span> <span m="887300">your</span> <span m="887410">spouse,</span> <span m="888380">and</span> <span m="888520">you</span> <span m="888600">change</span> <span m="888890">your</span> <span m="888950">mind,</span> <span m="889280">and</span> <span m="889370">then</span> <span m="889510">you</span> <span m="889610">go</span> <span m="889770">off</span> <span m="890030">and</span> <span m="890420">create</span> <span m="890680">a</span> <span m="890720">rogue</span> <span m="890920">couple.</span> <span m="891730">You're</span> <span m="892180">fixed</span> <span m="892690">in</span> <span m="892750">your</span> <span m="892870">preferences</span> <span m="893470">over all</span> <span m="893890">time,</span> <span m="894840">no</span> <span m="895070">playing</span> <span m="895400">the</span> <span m="895490">field,</span> <span m="895930">none</span> <span m="895980">of</span> <span m="896020">that</span> <span m="896220">stuff</span> <span m="896470">here,</span> <span m="896840">OK?</span> </p>
<p><span m="897150">So</span> <span m="897340">it's</span> <span m="897690">fixed</span> <span m="898070">once</span> <span m="898280">and</span> <span m="898390">for</span> <span m="898540">all,</span> <span m="900500">and</span> <span m="900680">your</span> <span m="900800">goal,</span> <span m="901200">of</span> <span m="901300">course,</span> <span m="901590">is</span> <span m="901690">to</span> <span m="901720">create</span> <span m="902400">or</span> <span m="902500">find</span> <span m="903680">a</span> <span m="904000">perfect</span> <span m="904540">matching</span> <span m="904930">that's</span> <span m="905080">stable.</span> <span m="906720">That's</span> <span m="907000">the</span> <span m="907090">goal.</span> <span m="911060">So</span> <span m="911300">get</span> <span m="911450">everybody</span> <span m="911910">married</span> <span m="912240">up</span> <span m="913330">and</span> <span m="913510">make</span> <span m="913690">it</span> <span m="913780">stable.</span> </p>
<p><span m="926820">All</span> <span m="926980">right,</span> <span m="927180">is</span> <span m="927310">it</span> <span m="927510">doable</span> <span m="927940">in</span> <span m="928000">that</span> <span m="928180">example?</span> <span m="929750">If</span> <span m="929890">I</span> <span m="929980">put</span> <span m="930200">those</span> <span m="930500">four</span> <span m="930710">people</span> <span m="931000">on</span> <span m="931130">a</span> <span m="931190">desert</span> <span m="931530">island,</span> <span m="931890">could</span> <span m="932080">I</span> <span m="932150">make</span> <span m="932750">a</span> <span m="932870">stable</span> <span m="934910">matching?</span> <span m="937250">Yeah,</span> <span m="937560">who</span> <span m="937710">would</span> <span m="937810">I</span> <span m="937990">match</span> <span m="938280">Brad</span> <span m="938610">to?</span> </p>
<p><span m="939430">AUDIENCE: Angelina.</span> </p>
<p><span m="940330">PROFESSOR: All right.</span> <span m="940670">Good,</span> <span m="940900">and</span> <span m="941010">then</span> <span m="941130">Billy</span> <span m="941430">Bob</span> <span m="941810">gets</span> <span m="942030">Jennifer.</span> <span m="943650">Now,</span> <span m="945010">I'm</span> <span m="945120">not</span> <span m="945330">saying</span> <span m="945750">that you</span> <span m="945890">make</span> <span m="946100">everybody</span> <span m="946470">happy,</span> <span m="948250">because</span> <span m="948380">Billy</span> <span m="948670">Bob</span> <span m="948990">and</span> <span m="949130">Jennifer</span> <span m="949425">are</span> <span m="949720">probably</span> <span m="950080">not</span> <span m="950360">happy</span> <span m="950740">there.</span> <span m="951820">They each</span> <span m="952060">got</span> <span m="952200">their</span> <span m="952300">number</span> <span m="952550">two</span> <span m="952730">choice.</span> <span m="953760">But</span> <span m="953970">it's</span> <span m="954190">stable,</span> <span m="955840">because</span> <span m="956380">Brad</span> <span m="956640">and</span> <span m="956720">Angelina</span> <span m="957150">aren't</span> <span m="957280">going</span> <span m="957540">anywhere.</span> </p>
<p><span m="958610">They</span> <span m="958820">are</span> <span m="958900">going</span> <span m="959000">to</span> <span m="959070">stay</span> <span m="959370">together</span> <span m="959880">because</span> <span m="960010">they</span> <span m="960110">like</span> <span m="960330">each</span> <span m="960470">other</span> <span m="960640">best,</span> <span m="961610">and</span> <span m="961900">so</span> <span m="962160">there's</span> <span m="962360">no</span> <span m="962550">chance</span> <span m="963020">that</span> <span m="963100">Jennifer is</span> <span m="963630">going</span> <span m="963760">to--</span> <span m="964460">that</span> <span m="964940">Angelina</span> <span m="965420">is</span> <span m="965500">going</span> <span m="965630">to</span> <span m="965740">sneak</span> <span m="966040">off,</span> <span m="966580">sorry,</span> <span m="966810">with</span> <span m="967120">Billy</span> <span m="967460">Bob,</span> <span m="968230">or</span> <span m="968580">that</span> <span m="970390">Brad's</span> <span m="970870">going</span> <span m="970990">to</span> <span m="971060">sneak</span> <span m="971340">off</span> <span m="971500">with</span> <span m="971590">Jennifer.</span> <span m="972690">All</span> <span m="972760">right?</span> <span m="973000">So</span> <span m="973130">it's</span> <span m="973330">stable.</span> <span m="974040">Not</span> <span m="974280">everybody's</span> <span m="974620">happy,</span> <span m="974980">but</span> <span m="975270">it's a</span> <span m="975490">stable</span> <span m="976550">set</span> <span m="976700">of</span> <span m="976770">marriages.</span> </p>
<p><span m="979510">OK.</span> <span m="982020">Any</span> <span m="982240">questions</span> <span m="982720">about</span> <span m="983270">what</span> <span m="983390">we're</span> <span m="983490">trying</span> <span m="983750">to</span> <span m="983820">do</span> <span m="983980">here</span> <span m="984170">now?</span> <span m="984360">Yeah?</span> </p>
<p><span m="985212">AUDIENCE:</span> <span m="985704">[INAUDIBLE]</span> <span m="989640">the edges?</span> </p>
<p><span m="990550">PROFESSOR: That's</span> <span m="990790">a</span> <span m="990820">great</span> <span m="991040">question.</span> <span m="991750">You'll</span> <span m="991930">see</span> <span m="992260">it</span> <span m="992630">referred</span> <span m="993030">to</span> <span m="993140">both</span> <span m="993440">ways.</span> <span m="994200">Technically,</span> <span m="994810">it's</span> <span m="994940">a</span> <span m="995000">subgraph,</span> <span m="995340">so</span> <span m="995680">it</span> <span m="995790">has</span> <span m="995970">nodes</span> <span m="996470">and</span> <span m="996800">edges,</span> <span m="997510">but</span> <span m="997740">you'll</span> <span m="997880">see</span> <span m="998140">me,</span> <span m="998530">and</span> <span m="998620">you'll</span> <span m="998760">see</span> <span m="998890">everybody</span> <span m="999160">say,</span> <span m="999570">oh,</span> <span m="999770">it's</span> <span m="999870">a</span> <span m="999970">bunch</span> <span m="1000070">of</span> <span m="1000170">edges</span> <span m="1000790">that</span> <span m="1000910">don't</span> <span m="1001320">share</span> <span m="1001600">any</span> <span m="1001710">nodes,</span> <span m="1002370">and</span> <span m="1002530">you'll</span> <span m="1002640">see</span> <span m="1002870">them</span> <span m="1002930">refer</span> <span m="1003290">to</span> <span m="1003440">it</span> <span m="1003500">as</span> <span m="1003610">the</span> <span m="1003740">edges.</span> <span m="1004040">But</span> <span m="1004170">really,</span> <span m="1004490">underlying</span> <span m="1005150">that,</span> <span m="1005340">it's a</span> <span m="1005570">subgraph,</span> <span m="1006592">technically.</span> </p>
<p><span m="1008320">Any</span> <span m="1008550">other</span> <span m="1008980">questions</span> <span m="1009520">about</span> <span m="1011300">what</span> <span m="1011490">we're</span> <span m="1011590">trying</span> <span m="1011800">to</span> <span m="1011860">do</span> <span m="1012030">here</span> <span m="1012220">to</span> <span m="1012300">find</span> <span m="1014020">stable,</span> <span m="1014460">perfect</span> <span m="1014770">matching?</span> <span m="1017842">All</span> <span m="1018299">right.</span> <span m="1018760">Well,</span> <span m="1019040">in</span> <span m="1019100">this</span> <span m="1019280">example,</span> <span m="1019900">there</span> <span m="1019950">was</span> <span m="1020650">a</span> <span m="1020730">stable,</span> <span m="1021100">perfect</span> <span m="1021450">matching.</span> <span m="1022900">But</span> <span m="1023030">what</span> <span m="1023200">about</span> <span m="1023430">in</span> <span m="1023550">general?</span> <span m="1024520">If</span> <span m="1024619">I</span> <span m="1024700">have</span> <span m="1024819">a</span> <span m="1024880">lot</span> <span m="1025140">more</span> <span m="1025349">people,</span> <span m="1025730">and they</span> <span m="1025829">have</span> <span m="1026010">arbitrary</span> <span m="1026569">preferences,</span> <span m="1028220">how</span> <span m="1028359">many</span> <span m="1028569">people</span> <span m="1028910">think</span> <span m="1029119">you</span> <span m="1029200">can</span> <span m="1029349">always</span> <span m="1029869">find</span> <span m="1030470">a</span> <span m="1030540">stable</span> <span m="1030980">perfect</span> <span m="1031339">matching?</span> </p>
<p><span m="1034099">There's</span> <span m="1034380">one</span> <span m="1034650">optimistic</span> <span m="1035160">person.</span> <span m="1035950">How</span> <span m="1036089">many</span> <span m="1036319">people</span> <span m="1036660">think</span> <span m="1036910">there's</span> <span m="1037069">some</span> <span m="1037310">cases</span> <span m="1037680">where</span> <span m="1037849">you're</span> <span m="1037970">just</span> <span m="1038190">not</span> <span m="1038390">going</span> <span m="1038490">to</span> <span m="1038530">be</span> <span m="1038619">able</span> <span m="1038770">to</span> <span m="1038859">do</span> <span m="1039079">it?</span> <span m="1040790">Wow.</span> <span m="1041329">OK,</span> <span m="1041849">it's a</span> <span m="1042160">pessimistic</span> <span m="1042750">view.</span> <span m="1043450">Well,</span> <span m="1043730">in</span> <span m="1043819">some</span> <span m="1044089">sense</span> <span m="1044420">you're</span> <span m="1044579">both</span> <span m="1044930">right.</span> <span m="1047099">If</span> <span m="1047710">you</span> <span m="1047880">allow</span> <span m="1048200">boys</span> <span m="1048840">to</span> <span m="1049030">prefer</span> <span m="1050340">boys</span> <span m="1051760">and</span> <span m="1051940">girls</span> <span m="1052290">to prefer</span> <span m="1052660">girls,</span> <span m="1053820">then</span> <span m="1054150">it</span> <span m="1054220">is</span> <span m="1054380">not</span> <span m="1054700">possible,</span> <span m="1055390">and</span> <span m="1055500">I'll</span> <span m="1055610">give</span> <span m="1055760">you</span> <span m="1055870">an</span> <span m="1055940">example.</span> </p>
<p><span m="1056600">You</span> <span m="1056720">can</span> <span m="1056870">find</span> <span m="1057120">examples</span> <span m="1057650">where</span> <span m="1057770">there's</span> <span m="1057960">always</span> <span m="1058410">a</span> <span m="1058490">rogue</span> <span m="1058710">couple,</span> <span m="1059560">but</span> <span m="1059840">if</span> <span m="1060090">you</span> <span m="1060760">require</span> <span m="1061320">boys</span> <span m="1061770">to</span> <span m="1061970">only</span> <span m="1062480">get</span> <span m="1062690">matched</span> <span m="1063030">to</span> <span m="1063130">girls</span> <span m="1063620">and</span> <span m="1063710">vice</span> <span m="1064000">versa,</span> <span m="1065310">then</span> <span m="1065530">it</span> <span m="1065720">is</span> <span m="1066070">possible</span> <span m="1066600">to</span> <span m="1066690">always</span> <span m="1067290">find</span> <span m="1068030">stable</span> <span m="1068460">marriages,</span> <span m="1068920">stable</span> <span m="1069290">matchings.</span> <span m="1070380">And we're</span> <span m="1070610">going</span> <span m="1070760">to</span> <span m="1070810">talk</span> <span m="1071030">about</span> <span m="1071180">an</span> <span m="1071270">algorithm</span> <span m="1071590">for</span> <span m="1071700">that.</span> <span m="1072460">But</span> <span m="1072670">before</span> <span m="1073030">I</span> <span m="1073110">show</span> <span m="1073380">you</span> <span m="1073610">the</span> <span m="1074410">algorithm,</span> <span m="1074870">let</span> <span m="1074980">me</span> <span m="1075090">show</span> <span m="1075290">you</span> <span m="1075400">the</span> <span m="1075520">bad</span> <span m="1075970">case</span> <span m="1077110">when</span> <span m="1077710">boys</span> <span m="1078110">can</span> <span m="1078200">prefer</span> <span m="1078610">boys,</span> <span m="1079040">or</span> <span m="1079170">what's sort</span> <span m="1079650">of</span> <span m="1079730">a</span> <span m="1079780">unisex</span> <span m="1081210">scenario.</span> </p>
<p><span m="1083460">So</span> <span m="1083540">here's</span> <span m="1083910">a</span> <span m="1083970">bad</span> <span m="1084270">example</span> <span m="1084720">with</span> <span m="1084860">four</span> <span m="1085110">people,</span> <span m="1087130">and</span> <span m="1087260">the</span> <span m="1087400">idea</span> <span m="1087890">is</span> <span m="1087960">to</span> <span m="1088070">create</span> <span m="1088350">a</span> <span m="1088410">love</span> <span m="1088660">triangle.</span> <span m="1090900">So</span> <span m="1091080">we</span> <span m="1091180">have</span> <span m="1091440">Alex,</span> <span m="1092990">who</span> <span m="1093260">prefers</span> <span m="1094050">Bobby</span> <span m="1094380">Joe,</span> <span m="1098370">Bobby</span> <span m="1098720">Joe</span> <span m="1099210">prefers</span> <span m="1100020">Robin,</span> <span m="1102850">and</span> <span m="1103010">Robin</span> <span m="1103480">prefers</span> <span m="1103950">Alex.</span> <span m="1105620">And</span> <span m="1105830">their</span> <span m="1105950">second</span> <span m="1106340">choices</span> <span m="1106820">go</span> <span m="1107030">in</span> <span m="1107090">the</span> <span m="1107220">opposite</span> <span m="1107760">order</span> <span m="1108060">there,</span> <span m="1108530">all</span> <span m="1108640">right?</span> </p>
<p><span m="1108850">So</span> <span m="1109640">Alex</span> <span m="1110050">wants</span> <span m="1110300">to be</span> <span m="1110390">with</span> <span m="1110480">Bobby</span> <span m="1110740">Joe.</span> <span m="1111100">Bobby</span> <span m="1111360">Joe</span> <span m="1111610">wants</span> <span m="1111800">be with</span> <span m="1111920">Robin.</span> <span m="1112350">Robin</span> <span m="1112680">wants</span> <span m="1112890">to be</span> <span m="1113000">with</span> <span m="1113120">Alex.</span> <span m="1113750">And</span> <span m="1113960">then</span> <span m="1114110">there's</span> <span m="1114290">Mergatoid--</span> </p>
<p><span m="1115448">[LAUGHTER]</span> </p>
<p></p>
<p><span m="1118260">--and</span> <span m="1118490">nobody</span> <span m="1119110">likes</span> <span m="1119500">Mergatoid.</span> <span m="1120310">So</span> <span m="1120600">that's</span> <span m="1121930">choice</span> <span m="1122300">three</span> <span m="1122690">for</span> <span m="1122880">all</span> <span m="1123080">of</span> <span m="1123170">them</span> <span m="1123320">here.</span> <span m="1125780">And</span> <span m="1126480">Mergatoid's</span> <span m="1127230">choices,</span> <span m="1127890">preferences</span> <span m="1128520">don't</span> <span m="1128780">really</span> <span m="1129070">matter</span> <span m="1130290">in</span> <span m="1130450">this</span> <span m="1130660">case.</span> </p>
<p><span m="1130915">[LAUGHTER]</span> </p>
<p></p>
<p><span m="1133420">I hope</span> <span m="1133870">nobody is</span> <span m="1134280">named</span> <span m="1134535">Mergatoid</span> <span m="1134940">in</span> <span m="1135010">the</span> <span m="1135130">class.</span> <span m="1137220">I would</span> <span m="1137360">get</span> <span m="1137560">complaints</span> <span m="1138050">here.</span> <span m="1139220">All</span> <span m="1139400">right,</span> <span m="1139700">so</span> <span m="1141210">I</span> <span m="1141350">want</span> <span m="1141570">to</span> <span m="1141640">claim</span> <span m="1142200">and</span> <span m="1142300">prove</span> <span m="1142520">a</span> <span m="1142590">theorem</span> <span m="1143010">that</span> <span m="1143120">says</span> <span m="1143470">there</span> <span m="1143740">is</span> <span m="1144110">no</span> <span m="1144510">stable</span> <span m="1145200">matching</span> <span m="1146130">for</span> <span m="1146280">this</span> <span m="1147110">group</span> <span m="1147300">of</span> <span m="1147410">preferences.</span> <span m="1148960">So</span> <span m="1149110">we'll</span> <span m="1149320">state</span> <span m="1149500">that</span> <span m="1149670">as</span> <span m="1149790">the</span> <span m="1149870">theorem.</span> <span m="1151336">There</span> <span m="1151820">does</span> <span m="1152050">not</span> <span m="1152330">exist</span> <span m="1154640">a</span> <span m="1154740">stable</span> <span m="1156300">matching</span> <span m="1157280">for</span> <span m="1157360">this</span> <span m="1157570">graph.</span> <span m="1163030">The</span> <span m="1163150">proof</span> <span m="1163590">is</span> <span m="1163750">by</span> <span m="1163900">contradiction--</span> <span m="1164930">assume</span> <span m="1165570">there</span> <span m="1165830">is</span> <span m="1165930">one.</span> </p>
<p><span m="1176260">All</span> <span m="1176340">right,</span> <span m="1176510">so</span> <span m="1176620">assume</span> <span m="1178020">there</span> <span m="1178190">exists</span> <span m="1178620">a</span> <span m="1178670">stable</span> <span m="1179030">matching.</span> <span m="1180320">We're</span> <span m="1180470">going</span> <span m="1180580">to</span> <span m="1180650">find</span> <span m="1180960">a</span> <span m="1181030">rogue</span> <span m="1181250">couple in</span> <span m="1181630">it.</span> <span m="1184570">So call</span> <span m="1184845">the</span> <span m="1185120">stable</span> <span m="1185580">matching</span> <span m="1186150">M.</span> <span m="1193700">Well,</span> <span m="1194790">if</span> <span m="1194930">there's</span> <span m="1195100">a</span> <span m="1195160">stable</span> <span m="1195550">matching,</span> <span m="1196040">Mergatoid's</span> <span m="1196770">got</span> <span m="1196940">to</span> <span m="1196990">get</span> <span m="1197160">married</span> <span m="1197440">to</span> <span m="1197510">somebody.</span> <span m="1210620">Mergatoid</span> <span m="1211200">will</span> <span m="1211310">be</span> <span m="1211460">matched</span> <span m="1212210">with</span> <span m="1212350">someone.</span> </p>
<p><span m="1219780">All</span> <span m="1219950">right.</span> <span m="1220130">Now,</span> <span m="1220540">here</span> <span m="1221030">I'm</span> <span m="1221130">going</span> <span m="1221230">to</span> <span m="1221320">do</span> <span m="1221510">something</span> <span m="1221890">that</span> <span m="1222390">you</span> <span m="1222520">can</span> <span m="1222690">do</span> <span m="1222870">in</span> <span m="1222940">your</span> <span m="1223080">proofs,</span> <span m="1223390">but you've</span> <span m="1223540">got</span> <span m="1223700">to</span> <span m="1223740">be</span> <span m="1223840">careful</span> <span m="1224180">when</span> <span m="1224280">you</span> <span m="1224360">do</span> <span m="1224610">it.</span> <span m="1224720">I'm</span> <span m="1224860">going</span> <span m="1224970">to</span> <span m="1225050">say,</span> <span m="1225630">without</span> <span m="1226080">loss</span> <span m="1226390">of</span> <span m="1226470">generality,</span> <span m="1228450">assume</span> <span m="1228745">Mergatoid</span> <span m="1230090">is</span> <span m="1230390">matched</span> <span m="1231200">to</span> <span m="1231340">Alex,</span> <span m="1233760">all</span> <span m="1233900">right?</span> <span m="1234250">And</span> <span m="1234410">I</span> <span m="1234480">can</span> <span m="1234710">do</span> <span m="1234950">that.</span> <span m="1235610">So</span> <span m="1235750">this</span> <span m="1235940">is</span> <span m="1236000">the</span> <span m="1236090">abbreviation,</span> <span m="1236780">without</span> <span m="1237090">loss</span> <span m="1237340">of</span> <span m="1237400">generality</span> <span m="1238600">by</span> <span m="1238770">symmetry.</span> </p>
<p><span m="1243080">And</span> <span m="1243280">really,</span> <span m="1243590">I</span> <span m="1243680">should</span> <span m="1243970">explain</span> <span m="1244420">what</span> <span m="1244550">I</span> <span m="1244610">mean</span> <span m="1244910">here</span> <span m="1245280">in</span> <span m="1245330">the</span> <span m="1245420">proof.</span> <span m="1246265">Well,</span> <span m="1246640">that</span> <span m="1246900">love</span> <span m="1247160">triangle</span> <span m="1247730">is</span> <span m="1247790">symmetric.</span> <span m="1249540">Each</span> <span m="1249740">one</span> <span m="1249960">has</span> <span m="1250210">a</span> <span m="1250270">preference</span> <span m="1250710">for</span> <span m="1250770">the</span> <span m="1250820">next</span> <span m="1251070">person</span> <span m="1251380">around</span> <span m="1251700">the</span> <span m="1251780">triangle.</span> <span m="1253670">In terms</span> <span m="1254020">of</span> <span m="1254080">graph</span> <span m="1254390">isomorphism,</span> <span m="1255330">with</span> <span m="1255540">the</span> <span m="1255640">weights</span> <span m="1255950">on</span> <span m="1256080">that,</span> <span m="1256610">every</span> <span m="1256860">node</span> <span m="1257110">looks</span> <span m="1257330">the</span> <span m="1257420">same.</span> <span m="1258030">So</span> <span m="1258060">I</span> <span m="1258110">can</span> <span m="1258260">use</span> <span m="1258510">symmetry.</span> </p>
<p><span m="1259880">So</span> <span m="1260070">we're</span> <span m="1260180">going</span> <span m="1260270">to</span> <span m="1260360">say,</span> <span m="1260550">without</span> <span m="1260860">loss</span> <span m="1261090">of</span> <span m="1261150">generality,</span> <span m="1263570">we're</span> <span m="1263720">going</span> <span m="1263920">to</span> <span m="1263980">assume</span> <span m="1265640">Mergatoid</span> <span m="1270720">is</span> <span m="1270880">matched</span> <span m="1271570">to</span> <span m="1271670">Alex.</span> <span m="1276410">And</span> <span m="1276650">I'm</span> <span m="1276750">implying</span> <span m="1277250">the</span> <span m="1277430">argument</span> <span m="1278040">is</span> <span m="1278210">going</span> <span m="1278340">to</span> <span m="1278390">be</span> <span m="1278530">the</span> <span m="1278650">same.</span> <span m="1279140">What</span> <span m="1279270">I</span> <span m="1279350">say</span> <span m="1279560">next</span> <span m="1279920">is</span> <span m="1280000">the</span> <span m="1280120">same</span> <span m="1281420">no</span> <span m="1281490">matter</span> <span m="1281730">who</span> <span m="1281980">Mergatoid</span> <span m="1282170">is</span> <span m="1282540">matched</span> <span m="1282880">to,</span> <span m="1283090">because</span> <span m="1283290">it's</span> <span m="1283390">symmetric.</span> </p>
<p><span m="1285920">All</span> <span m="1286080">right.</span> <span m="1286165">If</span> <span m="1286250">Mergatoid</span> <span m="1286840">is</span> <span m="1286980">matched</span> <span m="1287360">to</span> <span m="1287450">Alex,</span> <span m="1288350">do</span> <span m="1288440">you</span> <span m="1288510">see</span> <span m="1288740">a</span> <span m="1288810">rogue</span> <span m="1289080">couple</span> <span m="1289400">up</span> <span m="1289550">there?</span> <span m="1296410">So</span> <span m="1296590">you</span> <span m="1296680">have</span> <span m="1296850">Robin</span> <span m="1297250">matched</span> <span m="1297500">to</span> <span m="1297590">Bobby</span> <span m="1297920">Joe.</span> <span m="1298520">Mergatoid</span> <span m="1299000">is</span> <span m="1299090">matched to</span> <span m="1299450">Alex.</span> </p>
<p><span m="1301476">AUDIENCE: Alex to</span> <span m="1301938">Bobby</span> <span m="1302400">Joe?</span> </p>
<p><span m="1303330">PROFESSOR: Alex</span> <span m="1304160">and</span> <span m="1304530">Bobby</span> <span m="1304980">Joe,</span> <span m="1306370">no.</span> </p>
<p><span m="1306810">AUDIENCE: Between</span> <span m="1307250">Alex and Robin.</span> </p>
<p><span m="1308130">PROFESSOR: Alex</span> <span m="1308405">and</span> <span m="1308680">Robin,</span> <span m="1309180">yeah.</span> <span m="1309800">Alex</span> <span m="1310300">and Bobby</span> <span m="1310550">Joe</span> <span m="1310990">aren't</span> <span m="1311380">rogue,</span> <span m="1312920">because</span> <span m="1314170">Bobby Joe</span> <span m="1314460">likes</span> <span m="1314980">Robin.</span> <span m="1316560">He likes</span> <span m="1316870">the</span> <span m="1316960">person</span> <span m="1317890">he or</span> <span m="1318130">she is</span> <span m="1318370">married</span> <span m="1318770">to.</span> <span m="1320040">All</span> <span m="1320220">right,</span> <span m="1320520">so</span> <span m="1320840">they're</span> <span m="1320960">not</span> <span m="1321150">going</span> <span m="1321250">to</span> <span m="1321300">go</span> <span m="1321460">off</span> <span m="1321660">with</span> <span m="1321790">Alex,</span> <span m="1322570">but</span> <span m="1322760">Alex</span> <span m="1323090">and</span> <span m="1323180">Robin</span> <span m="1323540">are a</span> <span m="1323820">rogue</span> <span m="1324070">couple,</span> <span m="1324450">because</span> <span m="1324760">Robin</span> <span m="1325410">likes</span> <span m="1325680">Alex</span> <span m="1326040">the</span> <span m="1326130">best,</span> <span m="1327120">and</span> <span m="1327360">Alex</span> <span m="1327670">for</span> <span m="1327760">sure</span> <span m="1328060">likes</span> <span m="1328310">Robin</span> <span m="1328650">better</span> <span m="1328870">than</span> <span m="1328970">Mergatoid.</span> <span m="1330690">All</span> <span m="1330830">right?</span> <span m="1331130">So</span> <span m="1331370">they</span> <span m="1331810">both</span> <span m="1332170">prefer</span> <span m="1332420">each</span> <span m="1332580">other</span> <span m="1332770">to</span> <span m="1332870">their</span> <span m="1333020">mates,</span> <span m="1334730">and</span> <span m="1334970">so</span> <span m="1335070">they</span> <span m="1335250">form</span> <span m="1335960">a</span> <span m="1336110">rogue</span> <span m="1336440">couple.</span> </p>
<p><span m="1339640">All</span> <span m="1339800">right,</span> <span m="1340040">so</span> <span m="1342560">Alex</span> <span m="1344160">and</span> <span m="1344340">Robin</span> <span m="1347640">form</span> <span m="1348350">a</span> <span m="1348470">rogue</span> <span m="1348800">couple,</span> <span m="1351080">and</span> <span m="1351230">that</span> <span m="1351490">means</span> <span m="1351850">that</span> <span m="1352210">M</span> <span m="1352540">was</span> <span m="1352760">not</span> <span m="1353400">stable.</span> <span m="1357540">The</span> <span m="1357640">matching</span> <span m="1358100">was</span> <span m="1358260">not</span> <span m="1358480">stable.</span> <span m="1361250">And</span> <span m="1361400">that's</span> <span m="1361640">a</span> <span m="1361700">contradiction,</span> <span m="1362480">because</span> <span m="1362580">we</span> <span m="1362680">assumed</span> <span m="1362990">it</span> <span m="1363060">was.</span> <span m="1366290">So</span> <span m="1366370">we</span> <span m="1366430">have</span> <span m="1366530">a</span> <span m="1366590">contradiction,</span> <span m="1368330">and</span> <span m="1368640">the</span> <span m="1368720">proof</span> <span m="1368990">is</span> <span m="1369140">done.</span> <span m="1372250">Any</span> <span m="1372330">questions</span> <span m="1372645">about</span> <span m="1373100">that?</span> </p>
<p><span m="1375210">And</span> <span m="1375860">I'm</span> <span m="1376300">sort</span> <span m="1376520">of</span> <span m="1376590">implying</span> <span m="1377120">here</span> <span m="1377380">that</span> <span m="1377570">you</span> <span m="1377700">could</span> <span m="1377860">match,</span> <span m="1378370">you</span> <span m="1378740">could</span> <span m="1379090">have</span> <span m="1379180">had</span> <span m="1379660">Mergatoid</span> <span m="1380120">matched</span> <span m="1380360">to</span> <span m="1380450">Bobby</span> <span m="1380750">Joe,</span> <span m="1381840">and</span> <span m="1381980">then</span> <span m="1382140">Bobby</span> <span m="1382540">Joe</span> <span m="1383030">and</span> <span m="1383520">Alex</span> <span m="1383840">would</span> <span m="1383960">have</span> <span m="1384030">been</span> <span m="1384120">a</span> <span m="1384180">rogue</span> <span m="1384400">couple,</span> <span m="1384960">or</span> <span m="1385180">Mergatoid</span> <span m="1385690">matched</span> <span m="1385910">to</span> <span m="1386020">Robin,</span> <span m="1386450">and then</span> <span m="1386720">Robin</span> <span m="1387660">and</span> <span m="1388690">Bobby</span> <span m="1388950">Joe</span> <span m="1389490">would</span> <span m="1389610">be</span> <span m="1389750">a</span> <span m="1390185">rogue</span> <span m="1390520">couple</span> <span m="1391370">by</span> <span m="1391550">the</span> <span m="1391660">without</span> <span m="1391970">loss</span> <span m="1392230">of</span> <span m="1392280">generality.</span> <span m="1393910">So</span> <span m="1394080">it's</span> <span m="1394190">OK</span> <span m="1394470">to</span> <span m="1394510">use</span> <span m="1394780">that,</span> <span m="1395000">but</span> <span m="1395100">you</span> <span m="1395200">want</span> <span m="1395330">to</span> <span m="1395380">be</span> <span m="1395490">careful</span> <span m="1395940">that</span> <span m="1396060">you're</span> <span m="1396700">doing</span> <span m="1396840">it</span> <span m="1396980">OK.</span> <span m="1399110">Questions?</span> <span m="1402340">Yeah?</span> </p>
<p><span m="1402740">AUDIENCE: So</span> <span m="1403198">the without</span> <span m="1404114">loss of generality</span> <span m="1404572">only</span> <span m="1405030">works</span> <span m="1405488">if it's, like,</span> <span m="1405946">perfectly</span> <span m="1406404">symmetric?</span> </p>
<p><span m="1407320">PROFESSOR: Yeah.</span> <span m="1408550">Basically,</span> <span m="1408870">the</span> <span m="1409070">argument</span> <span m="1409470">you're</span> <span m="1409610">going</span> <span m="1409710">to</span> <span m="1409780">make</span> <span m="1410170">is</span> <span m="1410330">just</span> <span m="1410520">going</span> <span m="1410610">to</span> <span m="1410650">be</span> <span m="1410720">the</span> <span m="1410800">same</span> <span m="1411220">argument</span> <span m="1411700">done</span> <span m="1411910">in</span> <span m="1412000">all</span> <span m="1412390">three</span> <span m="1412710">cases,</span> <span m="1413680">and</span> <span m="1413890">to</span> <span m="1413960">save</span> <span m="1414300">yourself</span> <span m="1414680">some</span> <span m="1414850">effort,</span> <span m="1415620">you're</span> <span m="1415730">saying,</span> <span m="1416010">don't</span> <span m="1416290">do</span> <span m="1416380">the</span> <span m="1416510">three</span> <span m="1416690">cases,</span> <span m="1417100">do</span> <span m="1417250">one,</span> <span m="1417410">the</span> <span m="1417570">other</span> <span m="1417700">two</span> <span m="1417850">look</span> <span m="1418010">the</span> <span m="1418110">same.</span> <span m="1418990">So</span> <span m="1419100">technically,</span> <span m="1419770">you</span> <span m="1419850">could</span> <span m="1419980">add</span> <span m="1420120">case</span> <span m="1420390">one,</span> <span m="1420700">case</span> <span m="1420990">two,</span> <span m="1421180">case</span> <span m="1421460">three,</span> <span m="1421630">and</span> <span m="1421730">they</span> <span m="1421790">would've</span> <span m="1421970">looked</span> <span m="1422380">symmetric.</span> <span m="1424240">OK?</span> </p>
<p><span m="1426670">All right.</span> <span m="1426800">Now,</span> <span m="1427170">this</span> <span m="1427360">is</span> <span m="1427480">not</span> <span m="1427730">very</span> <span m="1427950">surprising,</span> <span m="1428520">as</span> <span m="1429230">you</span> <span m="1429370">all</span> <span m="1429600">voted.</span> <span m="1430300">Almost</span> <span m="1430670">all</span> <span m="1430850">of</span> <span m="1430930">you</span> <span m="1431040">said</span> <span m="1431330">it's</span> <span m="1431460">hard</span> <span m="1431670">to</span> <span m="1432120">find</span> <span m="1432440">stable</span> <span m="1432730">matchings.</span> <span m="1433090">You</span> <span m="1433190">might</span> <span m="1433390">not</span> <span m="1433570">be</span> <span m="1433640">able</span> <span m="1433750">to</span> <span m="1433850">do</span> <span m="1434050">it</span> <span m="1434110">always.</span> <span m="1434670">And</span> <span m="1434840">in</span> <span m="1434910">fact,</span> <span m="1435270">you</span> <span m="1435370">can't</span> <span m="1436200">in</span> <span m="1436320">the</span> <span m="1436430">unisex</span> <span m="1436920">world.</span> <span m="1437880">The</span> <span m="1438100">surprising</span> <span m="1438670">thing</span> <span m="1438850">is,</span> <span m="1439120">you</span> <span m="1439320">can</span> <span m="1439710">always</span> <span m="1440010">find</span> <span m="1440390">a</span> <span m="1440440">stable</span> <span m="1441230">matching</span> <span m="1442250">in</span> <span m="1442500">the</span> <span m="1442590">world</span> <span m="1442940">where</span> <span m="1443730">boys</span> <span m="1444100">could</span> <span m="1444280">only</span> <span m="1444700">be</span> <span m="1444970">paired</span> <span m="1445410">with</span> <span m="1445550">girls</span> <span m="1446070">and</span> <span m="1446220">vice</span> <span m="1446480">versa.</span> </p>
<p><span m="1448340">Now,</span> <span m="1449310">this</span> <span m="1449740">statement,</span> <span m="1450380">this</span> <span m="1450610">result</span> <span m="1451020">is</span> <span m="1451140">pretty</span> <span m="1451380">famous.</span> <span m="1452750">The</span> <span m="1452920">problem</span> <span m="1453270">itself</span> <span m="1453790">is</span> <span m="1453980">known</span> <span m="1455090">as</span> <span m="1455370">the</span> <span m="1455470">stable</span> <span m="1455860">marriage</span> <span m="1456340">problem.</span> <span m="1459300">So</span> <span m="1459400">let</span> <span m="1459530">me</span> <span m="1459640">just</span> <span m="1460660">define</span> <span m="1461090">it</span> <span m="1461160">here,</span> <span m="1462436">and</span> <span m="1462880">then</span> <span m="1463010">we'll</span> <span m="1463130">talk</span> <span m="1463370">about</span> <span m="1463630">an algorithm</span> <span m="1464200">to</span> <span m="1464300">find</span> <span m="1466760">the</span> <span m="1466870">matching.</span> </p>
<p><span m="1484030">So</span> <span m="1484250">we</span> <span m="1484350">have</span> <span m="1484930">N</span> <span m="1485240">boys</span> <span m="1487130">and</span> <span m="1487315">N</span> <span m="1487500">girls.</span> <span m="1491110">And</span> <span m="1491290">it's</span> <span m="1491400">important</span> <span m="1491810">we</span> <span m="1491900">have the</span> <span m="1491990">same</span> <span m="1492270">number</span> <span m="1492510">of</span> <span m="1492590">each.</span> <span m="1494190">Now,</span> <span m="1494360">actually,</span> <span m="1494770">tomorrow,</span> <span m="1495020">in</span> <span m="1495270">recitation,</span> <span m="1495980">you're</span> <span m="1496110">going</span> <span m="1496200">to</span> <span m="1496240">look</span> <span m="1496370">at</span> <span m="1496440">the</span> <span m="1496510">scenario</span> <span m="1497160">where</span> <span m="1498330">there's</span> <span m="1499170">more</span> <span m="1499540">girls</span> <span m="1500040">than</span> <span m="1500210">boys,</span> <span m="1500630">or</span> <span m="1500700">vice</span> <span m="1501010">versa.</span> <span m="1502010">And</span> <span m="1502710">you'll</span> <span m="1503010">be</span> <span m="1503140">using</span> <span m="1503490">a</span> <span m="1503540">similar</span> <span m="1503980">algorithm,</span> <span m="1504330">but</span> <span m="1504430">it'll</span> <span m="1504600">be</span> <span m="1504790">a</span> <span m="1504860">different</span> <span m="1505180">context,</span> <span m="1505750">and</span> <span m="1505820">that's</span> <span m="1506010">the</span> <span m="1506100">context</span> <span m="1506580">that</span> <span m="1506660">comes</span> <span m="1506970">up</span> <span m="1507530">in</span> <span m="1507670">matching</span> <span m="1508080">interns</span> <span m="1508790">to</span> <span m="1508880">hospitals,</span> <span m="1509590">and</span> <span m="1509730">stuff</span> <span m="1509980">like</span> <span m="1510170">that.</span> <span m="1511270">But</span> <span m="1511400">for</span> <span m="1511540">our</span> <span m="1511710">version</span> <span m="1512120">it's</span> <span m="1512270">an</span> <span m="1512330">equal</span> <span m="1512570">number</span> <span m="1512830">of</span> <span m="1512890">boys</span> <span m="1513180">and</span> <span m="1513280">girls.</span> </p>
<p><span m="1517690">Each</span> <span m="1518000">boy</span> <span m="1522220">has</span> <span m="1523350">his</span> <span m="1523740">own</span> <span m="1525810">ranked</span> <span m="1528430">preference</span> <span m="1528960">list</span> <span m="1531320">of</span> <span m="1531790">all</span> <span m="1532810">the</span> <span m="1532910">girls.</span> <span m="1535190">So</span> <span m="1535410">every</span> <span m="1535620">boy</span> <span m="1536030">sort</span> <span m="1536250">of</span> <span m="1536320">has</span> <span m="1536670">his</span> <span m="1537090">dance</span> <span m="1537440">card</span> <span m="1537850">of</span> <span m="1537950">the</span> <span m="1538040">girls</span> <span m="1538880">that</span> <span m="1539000">he</span> <span m="1539150">likes</span> <span m="1539550">in</span> <span m="1539740">order.</span> <span m="1540942">All right?</span> <span m="1541280">The</span> <span m="1541360">orders</span> <span m="1541610">can</span> <span m="1541700">be</span> <span m="1541800">different</span> <span m="1542120">for</span> <span m="1542200">different</span> <span m="1542460">boys.</span> <span m="1543580">And</span> <span m="1544020">each</span> <span m="1544270">girl</span> <span m="1544530">has</span> <span m="1544740">the</span> <span m="1544840">same</span> <span m="1545130">thing.</span> <span m="1546820">She</span> <span m="1547110">has</span> <span m="1547570">her</span> <span m="1547850">own</span> <span m="1548030">list,</span> <span m="1550040">ranked</span> <span m="1550380">1</span> <span m="1550610">to</span> <span m="1550710">n</span> <span m="1551810">of</span> <span m="1551960">all</span> <span m="1552160">the</span> <span m="1552230">boys.</span> </p>
<p><span m="1555670">The</span> <span m="1555770">lists</span> <span m="1556100">are</span> <span m="1556180">complete,</span> <span m="1556850">and</span> <span m="1557050">there's</span> <span m="1557220">no</span> <span m="1557480">ties,</span> <span m="1558390">so</span> <span m="1558540">all</span> <span m="1558780">the</span> <span m="1558850">ties</span> <span m="1559190">have</span> <span m="1559370">to</span> <span m="1559460">be</span> <span m="1559550">broken</span> <span m="1559910">here.</span> <span m="1561930">And</span> <span m="1561970">the</span> <span m="1562050">goal</span> <span m="1562440">is</span> <span m="1562510">to</span> <span m="1562610">find</span> <span m="1563080">a</span> <span m="1563130">perfect</span> <span m="1563540">matching</span> <span m="1563950">without</span> <span m="1564310">rogue</span> <span m="1564540">couples.</span> <span m="1585840">OK,</span> <span m="1586170">so</span> <span m="1586320">let's</span> <span m="1586750">try</span> <span m="1587080">an</span> <span m="1587150">example.</span> <span m="1588150">Before</span> <span m="1588450">we</span> <span m="1588550">do</span> <span m="1588680">the</span> <span m="1588850">algorithm,</span> <span m="1590990">let</span> <span m="1591080">me</span> <span m="1591200">just</span> <span m="1591400">do</span> <span m="1591540">a</span> <span m="1591600">bigger</span> <span m="1592230">example</span> <span m="1592730">with</span> <span m="1592870">five</span> <span m="1593140">boys</span> <span m="1593400">and</span> <span m="1593520">five</span> <span m="1593730">girls,</span> <span m="1596360">and</span> <span m="1596440">we'll</span> <span m="1596530">get</span> <span m="1596710">some</span> <span m="1597030">feel</span> <span m="1597440">for,</span> <span m="1598330">this</span> <span m="1598560">is</span> <span m="1598690">not</span> <span m="1598900">completely</span> <span m="1599400">obvious</span> <span m="1599760">how</span> <span m="1599870">to</span> <span m="1599960">find</span> <span m="1600260">it.</span> </p>
<p><span m="1622910">OK,</span> <span m="1623420">so</span> <span m="1625040">let's</span> <span m="1625150">put</span> <span m="1625280">the</span> <span m="1625340">boys</span> <span m="1625860">over</span> <span m="1626090">here.</span> <span m="1628360">And</span> <span m="1629870">here's</span> <span m="1630210">boy</span> <span m="1630460">1,</span> <span m="1632070">and</span> <span m="1632210">his</span> <span m="1632430">preference</span> <span m="1632920">list</span> <span m="1633250">is</span> <span m="1633370">going</span> <span m="1633490">to</span> <span m="1633550">be--</span> <span m="1633690">the</span> <span m="1633790">girls</span> <span m="1634120">will be</span> <span m="1634270">C,</span> <span m="1634530">B,</span> <span m="1637348">E,</span> <span m="1637840">A,</span> <span m="1639316">D,</span> <span m="1642700">and</span> <span m="1642890">boy</span> <span m="1643140">2</span> <span m="1645930">is</span> <span m="1646100">going</span> <span m="1646210">to</span> <span m="1646270">have</span> <span m="1646490">the</span> <span m="1646570">preference</span> <span m="1647060">list</span> <span m="1648460">A,</span> <span m="1651060">B,</span> <span m="1652042">E,</span> <span m="1652533">C,</span> <span m="1653515">D,</span> <span m="1658290">and</span> <span m="1658560">boy</span> <span m="1658830">3</span> <span m="1661570">is</span> <span m="1661670">going</span> <span m="1661770">to</span> <span m="1661850">have</span> <span m="1662440">D,</span> <span m="1663416">C,</span> <span m="1664392">B,</span> <span m="1665368">A,</span> <span m="1665856">E.</span> <span m="1667720">Boy</span> <span m="1668275">4</span> <span m="1670770">is</span> <span m="1670910">going</span> <span m="1671020">to</span> <span m="1671080">be</span> <span m="1671390">A,</span> <span m="1671900">C,</span> <span m="1672760">D,</span> <span m="1673190">B,</span> <span m="1673620">E,</span> <span m="1675440">and</span> <span m="1675850">boy</span> <span m="1676060">5,</span> <span m="1677345">I</span> <span m="1677680">have</span> <span m="1677790">to</span> <span m="1677900">write</span> <span m="1678100">his</span> <span m="1678400">across</span> <span m="1678810">like</span> <span m="1679000">this,</span> <span m="1680040">A,</span> <span m="1680710">B,</span> <span m="1681526">D,</span> <span m="1682342">E,</span> <span m="1682750">C.</span> </p>
<p><span m="1684100">And</span> <span m="1684250">the</span> <span m="1684320">girls</span> <span m="1684730">also</span> <span m="1685090">have</span> <span m="1686460">their</span> <span m="1686680">lists,</span> <span m="1687000">so</span> <span m="1687150">let's</span> <span m="1687330">put</span> <span m="1687500">those</span> <span m="1687730">up.</span> <span m="1694870">So</span> <span m="1695100">girl</span> <span m="1695380">A</span> <span m="1698080">likes</span> <span m="1698330">the</span> <span m="1698420">boys</span> <span m="1698780">in</span> <span m="1698860">order</span> <span m="1699150">3,</span> <span m="1700120">5,</span> <span m="1702260">2,</span> <span m="1702830">1,</span> <span m="1703290">4.</span> <span m="1705480">Girl</span> <span m="1706510">B</span> <span m="1709210">likes</span> <span m="1709510">them in</span> <span m="1709650">order</span> <span m="1709850">5,</span> <span m="1710470">2,</span> <span m="1711100">1,</span> <span m="1711830">4,</span> <span m="1712210">3.</span> <span m="1717880">Girl</span> <span m="1718240">C</span> <span m="1719790">has</span> <span m="1720050">the</span> <span m="1720190">order</span> <span m="1720950">4,</span> <span m="1721540">3,</span> <span m="1722360">5,</span> <span m="1723060">1,</span> <span m="1723530">2.</span> <span m="1725000">Girl</span> <span m="1725280">D,</span> <span m="1728184">1,</span> <span m="1728668">2,</span> <span m="1729640">3,</span> <span m="1730340">4,</span> <span m="1730940">5,</span> <span m="1732230">and</span> <span m="1732470">then</span> <span m="1732670">the</span> <span m="1732750">last</span> <span m="1733060">girl,</span> <span m="1733390">E,</span> <span m="1735200">has</span> <span m="1735490">2,</span> <span m="1736240">3,</span> <span m="1737150">4,</span> <span m="1737930">1,</span> <span m="1738670">5.</span> </p>
<p><span m="1740130">All</span> <span m="1740260">right,</span> <span m="1740490">so</span> <span m="1740610">say</span> <span m="1741000">that's</span> <span m="1741480">our</span> <span m="1742180">matching</span> <span m="1742580">problem,</span> <span m="1743220">and</span> <span m="1743340">those</span> <span m="1743580">are</span> <span m="1743600">the</span> <span m="1743680">preference</span> <span m="1744150">lists.</span> <span m="1746580">Any</span> <span m="1746780">ideas</span> <span m="1747240">for</span> <span m="1747350">how</span> <span m="1747530">we</span> <span m="1747630">might</span> <span m="1747980">try</span> <span m="1748280">to</span> <span m="1748360">make</span> <span m="1748530">an</span> <span m="1748630">algorithm</span> <span m="1748970">to</span> <span m="1749080">do</span> <span m="1749220">this?</span> <span m="1749460">Any</span> <span m="1749660">thoughts</span> <span m="1750160">about</span> <span m="1750390">what</span> <span m="1750530">you'd</span> <span m="1750640">do?</span> <span m="1752050">What</span> <span m="1752180">are</span> <span m="1752240">some</span> <span m="1752380">approaches</span> <span m="1752860">we</span> <span m="1752930">could</span> <span m="1753070">take?</span> <span m="1753290">Yeah?</span> </p>
<p><span m="1753710">AUDIENCE: Use the</span> <span m="1754176">mating</span> <span m="1754642">algorithm.</span> </p>
<p><span m="1755110">PROFESSOR: Use</span> <span m="1755360">the</span> <span m="1755440">greedy</span> <span m="1755810">algorithm?</span> </p>
<p><span m="1756170">AUDIENCE: The</span> <span m="1756530">mating algorithm.</span> </p>
<p><span m="1757690">PROFESSOR: Oh,</span> <span m="1757800">the</span> <span m="1757880">mating</span> <span m="1758230">algorithm.</span> <span m="1758500">Well,</span> <span m="1758610">yeah,</span> <span m="1758770">the</span> <span m="1758930">mating</span> <span m="1759240">algorithm</span> <span m="1759310">is</span> <span m="1759530">going</span> <span m="1759630">to</span> <span m="1759670">do</span> <span m="1759800">very</span> <span m="1760100">well,</span> <span m="1761020">but</span> <span m="1761200">I</span> <span m="1761270">haven't</span> <span m="1761540">told</span> <span m="1761750">you</span> <span m="1761820">what</span> <span m="1761930">that</span> <span m="1762150">is,</span> <span m="1762240">and</span> <span m="1762330">it's</span> <span m="1762520">a</span> <span m="1762600">little</span> <span m="1762840">complicated.</span> <span m="1764320">So</span> <span m="1764420">I</span> <span m="1764470">sort</span> <span m="1764660">of</span> <span m="1764720">want</span> <span m="1764870">to</span> <span m="1764940">explore</span> <span m="1765940">the</span> <span m="1766030">things</span> <span m="1766250">you</span> <span m="1766350">might</span> <span m="1766710">know</span> <span m="1766880">from</span> <span m="1767280">what</span> <span m="1767400">we've</span> <span m="1767540">done</span> <span m="1767730">so</span> <span m="1767920">far.</span> <span m="1770000">What</span> <span m="1770370">approaches</span> <span m="1770830">have</span> <span m="1770940">we</span> <span m="1771050">seen</span> <span m="1771290">so</span> <span m="1771490">far</span> <span m="1771810">for</span> <span m="1771970">solving</span> <span m="1773270">problems?</span> <span m="1774830">Yeah?</span> </p>
<p><span m="1775605">AUDIENCE: The greedy</span> <span m="1776080">algorithm?</span> </p>
<p><span m="1777030">PROFESSOR: The</span> <span m="1777140">greedy</span> <span m="1777510">algorithm--</span> <span m="1778470">yep.</span> <span m="1778910">And</span> <span m="1779810">let's</span> <span m="1780020">try</span> <span m="1780280">that.</span> <span m="1781500">So</span> <span m="1781580">let's</span> <span m="1782470">choose</span> <span m="1782820">the</span> <span m="1782900">first</span> <span m="1783230">boy,</span> <span m="1784560">and</span> <span m="1785370">we'll</span> <span m="1785510">just</span> <span m="1785990">go</span> <span m="1786180">down</span> <span m="1786480">and</span> <span m="1786580">give</span> <span m="1786770">each</span> <span m="1787050">boy</span> <span m="1787370">the</span> <span m="1787930">best</span> <span m="1788260">choice</span> <span m="1788590">available</span> <span m="1788875">and</span> <span m="1789200">see</span> <span m="1789340">what</span> <span m="1789450">happens.</span> <span m="1792370">First</span> <span m="1792530">thing</span> <span m="1792650">to</span> <span m="1792710">try</span> <span m="1793040">usually</span> <span m="1793470">is</span> <span m="1793760">the</span> <span m="1793850">greedy</span> <span m="1794180">algorithm,</span> <span m="1794540">and</span> <span m="1794610">about</span> <span m="1794840">half</span> <span m="1795130">the</span> <span m="1795230">time</span> <span m="1795480">it'll</span> <span m="1795640">work</span> <span m="1796710">in</span> <span m="1796840">life,</span> <span m="1797220">and</span> <span m="1797640">half</span> <span m="1797880">the</span> <span m="1797970">time</span> <span m="1798190">it</span> <span m="1798250">won't.</span> </p>
<p><span m="1802620">So</span> <span m="1803060">let's</span> <span m="1803230">try</span> <span m="1803450">greedy.</span> <span m="1807530">So</span> <span m="1807790">boy</span> <span m="1808080">1</span> <span m="1809550">is</span> <span m="1809720">going</span> <span m="1809850">to</span> <span m="1809910">get</span> <span m="1810510">his</span> <span m="1810690">first</span> <span m="1810980">choice,</span> <span m="1811330">girl</span> <span m="1811610">C.</span> <span m="1814090">Who does</span> <span m="1814390">boy</span> <span m="1814610">2</span> <span m="1814840">get?</span> <span m="1818560">A.</span> <span m="1819720">Who</span> <span m="1819920">does</span> <span m="1820030">boy</span> <span m="1820360">3</span> <span m="1820620">get?</span> <span m="1822990">D.</span> <span m="1824220">Huh,</span> <span m="1824325">this</span> <span m="1824430">is</span> <span m="1824530">going</span> <span m="1824760">well.</span> </p>
<p><span m="1825340">Who</span> <span m="1825470">does</span> <span m="1825610">boy</span> <span m="1825810">4</span> <span m="1826110">get?</span> <span m="1829460">Boy</span> <span m="1830050">4,</span> <span m="1830740">oh</span> <span m="1830900">yeah,</span> <span m="1831110">boy</span> <span m="1831435">4 has</span> <span m="1831760">got</span> <span m="1831920">to go</span> <span m="1831980">all</span> <span m="1832350">the</span> <span m="1832420">way</span> <span m="1832540">down</span> <span m="1832800">to</span> <span m="1832860">B,</span> <span m="1833450">because</span> <span m="1833830">A,</span> <span m="1833990">C, and D</span> <span m="1834470">got</span> <span m="1834750">taken,</span> <span m="1835200">so</span> <span m="1835250">boy</span> <span m="1835540">4</span> <span m="1835860">gets B.</span> <span m="1837710">And</span> <span m="1837900">boy</span> <span m="1838140">5--</span> <span m="1839150">who's</span> <span m="1839380">left?</span> <span m="1840840">E,</span> <span m="1841560">fourth</span> <span m="1841840">choice</span> <span m="1842160">again.</span> <span m="1843790">All</span> <span m="1844010">right,</span> <span m="1844350">well,</span> <span m="1845370">maybe</span> <span m="1845720">that's</span> <span m="1845980">a</span> <span m="1846040">stable</span> <span m="1847580">matching.</span> </p>
<p><span m="1849320">All</span> <span m="1849440">right,</span> <span m="1850130">well</span> <span m="1850290">let's</span> <span m="1850640">see.</span> <span m="1851160">To</span> <span m="1851280">see</span> <span m="1851490">if it's</span> <span m="1851610">stable,</span> <span m="1851810">we've</span> <span m="1852010">got to</span> <span m="1852250">see</span> <span m="1852370">are</span> <span m="1852460">there</span> <span m="1852590">any</span> <span m="1852730">rogue</span> <span m="1853050">couples.</span> <span m="1855400">Well,</span> <span m="1856050">is</span> <span m="1856240">there</span> <span m="1856380">any</span> <span m="1856600">rogue</span> <span m="1856950">couple</span> <span m="1857350">involving</span> <span m="1857790">boy</span> <span m="1858010">1?</span> <span m="1860030">No,</span> <span m="1860220">boy</span> <span m="1860420">1</span> <span m="1860700">got</span> <span m="1860830">his</span> <span m="1860960">first</span> <span m="1861240">choice.</span> <span m="1862070">You're</span> <span m="1862350">not</span> <span m="1862500">going</span> <span m="1862730">anywhere.</span> </p>
<p><span m="1864000">Boy</span> <span m="1864210">2?</span> <span m="1865670">No--</span> <span m="1865950">first</span> <span m="1866270">choice,</span> <span m="1866820">same</span> <span m="1867030">with</span> <span m="1867150">boy</span> <span m="1867460">3.</span> <span m="1868080">These</span> <span m="1868290">boys</span> <span m="1868630">are</span> <span m="1868700">quite</span> <span m="1868980">happy.</span> <span m="1869650">They're</span> <span m="1869790">not</span> <span m="1870000">doing</span> <span m="1870200">anything.</span> <span m="1871770">Boy</span> <span m="1872010">4</span> <span m="1872400">may</span> <span m="1872530">not</span> <span m="1872710">be</span> <span m="1872820">so</span> <span m="1873020">happy</span> <span m="1873330">though,</span> <span m="1874550">because</span> <span m="1874990">boy</span> <span m="1875230">4</span> <span m="1875510">got</span> <span m="1875720">paired</span> <span m="1876040">with</span> <span m="1876180">B,</span> <span m="1877930">so</span> <span m="1878260">there's</span> <span m="1878510">possible</span> <span m="1879120">rogue</span> <span m="1879420">couples.</span> <span m="1879950">Let's</span> <span m="1880200">see,</span> <span m="1880576">is</span> <span m="1880952">4, A</span> <span m="1881330">a</span> <span m="1881430">rogue</span> <span m="1881800">couple?</span> <span m="1885650">No.</span> <span m="1886920">A</span> <span m="1887240">hates</span> <span m="1887640">boy</span> <span m="1887880">4,</span> <span m="1889200">all right?</span> <span m="1889660">No</span> <span m="1889950">chance</span> <span m="1890500">she's</span> <span m="1890770">running</span> <span m="1891050">off</span> <span m="1891250">with</span> <span m="1891320">boy</span> <span m="1891590">4.</span> </p>
<p><span m="1892566">AUDIENCE: 4, C?</span> </p>
<p><span m="1893542">PROFESSOR: 4, C?</span> <span m="1894720">All</span> <span m="1894900">right,</span> <span m="1895140">let's</span> <span m="1895170">see</span> <span m="1895450">that.</span> <span m="1896330">Where's</span> <span m="1896900">C--</span> <span m="1897276">whoa,</span> <span m="1898030">yeah.</span> <span m="1899570">C</span> <span m="1900530">has</span> <span m="1900770">the</span> <span m="1900860">hots</span> <span m="1901140">for</span> <span m="1901260">boy</span> <span m="1901520">4,</span> <span m="1902770">so</span> <span m="1902990">she</span> <span m="1903210">likes</span> <span m="1903510">him</span> <span m="1903740">better</span> <span m="1903940">than</span> <span m="1904140">whoever</span> <span m="1904240">her</span> <span m="1904570">mate</span> <span m="1904850">was,</span> <span m="1905990">and</span> <span m="1906180">boy</span> <span m="1906410">4</span> <span m="1906730">likes</span> <span m="1907000">C</span> <span m="1907325">better</span> <span m="1907650">than</span> <span m="1908420">who</span> <span m="1908560">he</span> <span m="1908690">got</span> <span m="1908910">matched</span> <span m="1909240">with,</span> <span m="1909380">boy</span> <span m="1909640">B.</span> <span m="1909840">That</span> <span m="1910080">is</span> <span m="1910220">now</span> <span m="1910420">a</span> <span m="1910540">rogue</span> <span m="1910810">couple,</span> <span m="1911840">so</span> <span m="1911950">the</span> <span m="1912080">greedy</span> <span m="1912440">algorithm</span> <span m="1912910">did</span> <span m="1913100">not</span> <span m="1913360">work.</span> <span m="1914550">That's</span> <span m="1914790">too</span> <span m="1914920">bad.</span> <span m="1915860">Well,</span> <span m="1915885">it</span> <span m="1915910">would</span> <span m="1916040">be</span> <span m="1916160">short</span> <span m="1916420">lecture,</span> <span m="1916720">I</span> <span m="1916750">guess,</span> <span m="1916855">if</span> <span m="1916960">it</span> <span m="1917100">worked.</span> </p>
<p><span m="1917400">[LAUGHTER]</span> </p>
<p></p>
<p><span m="1921310">Well,</span> <span m="1922250">what</span> <span m="1922480">would</span> <span m="1922590">you</span> <span m="1922700">do</span> <span m="1922950">next,</span> <span m="1923370">sort</span> <span m="1923590">of,</span> <span m="1923840">if</span> <span m="1923950">you</span> <span m="1924070">were--</span> <span m="1926710">I mean,</span> <span m="1926850">you</span> <span m="1926970">could</span> <span m="1927890">try</span> <span m="1928140">to</span> <span m="1928240">match</span> <span m="1928720">4</span> <span m="1929080">with</span> <span m="1929230">C,</span> <span m="1930670">and then</span> <span m="1930830">try</span> <span m="1931010">to</span> <span m="1931110">patch</span> <span m="1931470">things</span> <span m="1931760">up,</span> <span m="1933020">and</span> <span m="1933180">you</span> <span m="1933280">could</span> <span m="1933410">start</span> <span m="1933690">doing</span> <span m="1933880">that,</span> <span m="1934070">but</span> <span m="1934150">you</span> <span m="1934230">might</span> <span m="1934400">create</span> <span m="1935300">other</span> <span m="1935480">rogue</span> <span m="1935700">couples.</span> <span m="1936300">In</span> <span m="1936370">fact,</span> <span m="1936610">I</span> <span m="1936720">don't</span> <span m="1936930">know</span> <span m="1937150">an</span> <span m="1937280">approach--</span> <span m="1937720">yeah?</span> </p>
<p><span m="1938560">AUDIENCE: You could</span> <span m="1938900">let it</span> <span m="1939240">evolve</span> <span m="1939633">and see</span> <span m="1940026">if it</span> <span m="1940420">gets it more</span> <span m="1940895">stable.</span> </p>
<p><span m="1941370">PROFESSOR: Say</span> <span m="1941530">it</span> <span m="1941590">again.</span> </p>
<p><span m="1942370">AUDIENCE: You could let it evolve,</span> <span m="1942853">let</span> <span m="1943336">all the</span> <span m="1943819">rogue</span> <span m="1944302">couples</span> <span m="1944543">evolve</span> <span m="1944785">and see</span> <span m="1945268">if it</span> <span m="1945751">ends up any more</span> <span m="1946234">stable.</span> </p>
<p><span m="1946717">PROFESSOR: Yes,</span> <span m="1947200">you</span> <span m="1947690">could</span> <span m="1947760">start</span> <span m="1948210">swapping</span> <span m="1948590">around</span> <span m="1949080">to</span> <span m="1949140">get</span> <span m="1949360">rid</span> <span m="1949500">of</span> <span m="1949620">rogue</span> <span m="1949860">couples.</span> <span m="1951360">In</span> <span m="1951590">doing</span> <span m="1951940">that,</span> <span m="1952450">you</span> <span m="1952580">might</span> <span m="1952770">create</span> <span m="1953070">other</span> <span m="1953280">rogue</span> <span m="1953500">couples.</span> <span m="1954570">In fact,</span> <span m="1954850">I</span> <span m="1954920">don't</span> <span m="1955130">know</span> <span m="1955340">of</span> <span m="1955510">an</span> <span m="1955610">algorithm</span> <span m="1956230">that</span> <span m="1956380">works</span> <span m="1957010">like</span> <span m="1957230">this,</span> <span m="1957430">that</span> <span m="1957520">works,</span> <span m="1957930">that's</span> <span m="1958060">known</span> <span m="1958260">to</span> <span m="1958340">work,</span> <span m="1958650">where</span> <span m="1958935">you start</span> <span m="1959840">patching</span> <span m="1960190">things</span> <span m="1960450">up,</span> <span m="1960640">because</span> <span m="1960930">as</span> <span m="1961010">you're</span> <span m="1961130">patching</span> <span m="1961470">things</span> <span m="1961700">up,</span> <span m="1962110">you</span> <span m="1962260">might</span> <span m="1962440">make</span> <span m="1962740">other</span> <span m="1962980">things</span> <span m="1963270">much</span> <span m="1963470">worse</span> <span m="1964010">by</span> <span m="1964140">doing</span> <span m="1964450">that.</span> <span m="1965610">So</span> <span m="1965730">I</span> <span m="1965790">don't</span> <span m="1966050">know</span> <span m="1966180">of</span> <span m="1966240">an</span> <span m="1966310">approach</span> <span m="1967010">that</span> <span m="1967280">way.</span> </p>
<p><span m="1970190">What's</span> <span m="1970470">another</span> <span m="1970850">approach?</span> <span m="1971040">Yeah?</span> </p>
<p><span m="1971550">AUDIENCE:</span> <span m="1972045">[INAUDIBLE]</span> <span m="1976500">pertaining to what</span> <span m="1976995">order</span> <span m="1977490">they have each other.</span> </p>
<p><span m="1978480">PROFESSOR: And</span> <span m="1978975">then do?</span> </p>
<p><span m="1979965">AUDIENCE: And then do</span> <span m="1980955">the highest</span> <span m="1981450">ordered</span> <span m="1981945">[INAUDIBLE]</span> </p>
<p><span m="1982440">PROFESSOR: Min-weight matching</span> <span m="1982935">kind of</span> <span m="1983430">thing?</span> </p>
<p><span m="1984420">AUDIENCE: Maybe.</span> </p>
<p><span m="1984915">PROFESSOR: Maybe?</span> <span m="1985410">I</span> <span m="1985905">don't</span> <span m="1986400">of an approach</span> <span m="1986895">like that that</span> <span m="1987410">works.</span> <span m="1989200">Also,</span> <span m="1989510">min-weight</span> <span m="1989790">matching,</span> <span m="1990420">that</span> <span m="1990640">algorithm</span> <span m="1991190">is</span> <span m="1991310">going</span> <span m="1991410">to</span> <span m="1991450">be</span> <span m="1991600">more</span> <span m="1991850">complicated</span> <span m="1992460">than</span> <span m="1992550">the</span> <span m="1992640">one</span> <span m="1992800">I'm</span> <span m="1992880">going</span> <span m="1993000">to</span> <span m="1993040">show</span> <span m="1993310">you,</span> <span m="1993480">in</span> <span m="1993550">the</span> <span m="1993640">end.</span> <span m="1993760">It</span> <span m="1993850">takes</span> <span m="1994040">more</span> <span m="1994170">time</span> <span m="1994390">to</span> <span m="1994500">run.</span> <span m="1996560">And</span> <span m="1996700">I</span> <span m="1996730">don't even</span> <span m="1996920">know</span> <span m="1997040">if</span> <span m="1997110">it</span> <span m="1997170">works.</span> <span m="1997760">Like,</span> <span m="1997920">I</span> <span m="1997960">don't</span> <span m="1998050">know</span> <span m="1998120">if</span> <span m="1998180">you</span> <span m="1998280">can</span> <span m="1998440">take</span> <span m="1998710">these</span> <span m="1999030">numbers</span> <span m="1999770">and</span> <span m="1999990">make</span> <span m="2000310">weights</span> <span m="2000690">on</span> <span m="2000790">the</span> <span m="2000940">edges</span> <span m="2001340">get</span> <span m="2001500">a</span> <span m="2001550">min-weight</span> <span m="2001840">matching.</span> </p>
<p><span m="2002115">AUDIENCE: Could you do</span> <span m="2002390">like a</span> <span m="2002837">merge sort</span> <span m="2003284">[INAUDIBLE]</span> </p>
<p><span m="2005072">PROFESSOR: Oh, a</span> <span m="2005520">merge</span> <span m="2005980">sort,</span> <span m="2006440">so</span> <span m="2006550">you</span> <span m="2006710">take</span> <span m="2006950">the</span> <span m="2007040">minimum</span> <span m="2007460">weight</span> <span m="2007660">edge,</span> <span m="2007990">put</span> <span m="2008150">that</span> <span m="2008370">in,</span> <span m="2008510">and</span> <span m="2008590">recurse</span> <span m="2008990">on</span> <span m="2009120">that</span> <span m="2009420">kind</span> <span m="2009580">of</span> <span m="2009680">thing.</span> <span m="2011490">I</span> <span m="2011590">don't</span> <span m="2011730">know.</span> <span m="2011990">It's</span> <span m="2012090">possible.</span> <span m="2014140">In</span> <span m="2014240">fact,</span> <span m="2014450">you know what, a</span> <span m="2014780">recursive</span> <span m="2015300">approach</span> <span m="2015690">is</span> <span m="2015800">a</span> <span m="2015860">good</span> <span m="2016050">idea.</span> <span m="2017180">I</span> <span m="2017300">don't</span> <span m="2017530">know</span> <span m="2017790">of a</span> <span m="2017890">nice</span> <span m="2018180">recursive</span> <span m="2018620">algorithm</span> <span m="2018990">for</span> <span m="2019100">this.</span> </p>
<p><span m="2020210">It's</span> <span m="2020420">true</span> <span m="2020810">that</span> <span m="2020940">if</span> <span m="2021050">you</span> <span m="2021150">found</span> <span m="2021600">a</span> <span m="2021640">boy</span> <span m="2021940">and</span> <span m="2022040">a</span> <span m="2022140">girl</span> <span m="2022310">who</span> <span m="2022450">liked</span> <span m="2022710">each</span> <span m="2022870">other</span> <span m="2023040">best,</span> <span m="2024680">you</span> <span m="2024850">could</span> <span m="2025260">then</span> <span m="2025430">match</span> <span m="2025790">them</span> <span m="2026050">safely</span> <span m="2026360">and</span> <span m="2026670">recurse,</span> <span m="2027780">because</span> <span m="2028020">you</span> <span m="2028130">know</span> <span m="2028490">they're</span> <span m="2028620">not</span> <span m="2028780">going</span> <span m="2028870">to</span> <span m="2028910">be</span> <span m="2028980">in</span> <span m="2029050">a</span> <span m="2029100">rogue</span> <span m="2029290">couple,</span> <span m="2029580">because</span> <span m="2029700">they</span> <span m="2029780">like</span> <span m="2029990">each</span> <span m="2030120">other</span> <span m="2030280">best.</span> <span m="2030990">Then</span> <span m="2031170">you</span> <span m="2031270">could</span> <span m="2031390">recurse.</span> <span m="2032610">But</span> <span m="2032740">that</span> <span m="2032910">might</span> <span m="2033090">not</span> <span m="2033260">exist</span> <span m="2034070">here.</span> <span m="2034980">You</span> <span m="2035100">might</span> <span m="2035320">not</span> <span m="2035520">have</span> <span m="2035670">a</span> <span m="2035740">boy</span> <span m="2035980">and girl</span> <span m="2036210">that</span> <span m="2036330">like</span> <span m="2036530">each</span> <span m="2036660">other</span> <span m="2036850">best,</span> <span m="2037610">in</span> <span m="2037730">which</span> <span m="2037910">case</span> <span m="2038140">it's</span> <span m="2038270">hard</span> <span m="2038500">to</span> <span m="2038580">know.</span> </p>
<p><span m="2039450">I</span> <span m="2039590">don't</span> <span m="2039810">know</span> <span m="2040050">now</span> <span m="2040270">if</span> <span m="2040340">you</span> <span m="2040460">pick</span> <span m="2040690">the</span> <span m="2040770">minimum</span> <span m="2041310">weight</span> <span m="2041630">in</span> <span m="2041740">some</span> <span m="2041980">sense,</span> <span m="2042350">like</span> <span m="2042520">add</span> <span m="2042860">the</span> <span m="2043020">preference</span> <span m="2043520">list</span> <span m="2043900">or</span> <span m="2043970">something</span> <span m="2044320">to</span> <span m="2044370">make</span> <span m="2044510">a</span> <span m="2044650">min-weight</span> <span m="2045290">and</span> <span m="2045410">recurse</span> <span m="2045770">on</span> <span m="2045870">that,</span> <span m="2046010">if</span> <span m="2046090">that</span> <span m="2046260">works.</span> <span m="2047240">I</span> <span m="2047330">don't</span> <span m="2047520">know</span> <span m="2047640">of an</span> <span m="2047730">approach</span> <span m="2048070">like</span> <span m="2048250">that.</span> <span m="2049670">But</span> <span m="2049750">those</span> <span m="2049969">are</span> <span m="2050010">the</span> <span m="2050100">kinds</span> <span m="2050290">of</span> <span m="2050360">things</span> <span m="2050550">you</span> <span m="2050670">try.</span> <span m="2051679">And</span> <span m="2051830">as</span> <span m="2051920">far</span> <span m="2052070">as</span> <span m="2052159">I</span> <span m="2052210">know,</span> <span m="2052489">all</span> <span m="2052739">the</span> <span m="2052850">simple</span> <span m="2053170">things</span> <span m="2053429">fail</span> <span m="2054190">for</span> <span m="2054280">this</span> <span m="2054460">problem.</span> </p>
<p><span m="2055199">But</span> <span m="2055380">there</span> <span m="2055510">is</span> <span m="2055699">something</span> <span m="2056040">that's</span> <span m="2056900">a</span> <span m="2057010">little</span> <span m="2058000">more</span> <span m="2058909">involved,</span> <span m="2059889">but</span> <span m="2060070">does</span> <span m="2060310">work,</span> <span m="2061159">and</span> <span m="2061840">that's</span> <span m="2062090">the</span> <span m="2062170">mating</span> <span m="2062570">algorithm.</span> <span m="2062980">And</span> <span m="2063190">does</span> <span m="2063350">everybody</span> <span m="2063620">have</span> <span m="2063880">the</span> <span m="2063969">handout?</span> <span m="2065739">There,</span> <span m="2065900">it's</span> <span m="2066020">back</span> <span m="2066280">up</span> <span m="2066370">there.</span> <span m="2066520">I</span> <span m="2066570">got</span> <span m="2066739">some</span> <span m="2066860">copies</span> <span m="2067210">down</span> <span m="2067429">here</span> <span m="2067590">if</span> <span m="2067639">you</span> <span m="2067730">need</span> <span m="2067920">it,</span> <span m="2068010">but</span> <span m="2068080">pull</span> <span m="2068320">that</span> <span m="2068530">out.</span> <span m="2070237">So</span> <span m="2070679">we're</span> <span m="2070800">going</span> <span m="2070909">to</span> <span m="2071219">read</span> <span m="2071560">this</span> <span m="2072350">and</span> <span m="2072620">talk</span> <span m="2072810">about</span> <span m="2072969">what</span> <span m="2073130">the</span> <span m="2073280">algorithm</span> <span m="2073670">is,</span> <span m="2073830">and</span> <span m="2073920">then</span> <span m="2074100">prove</span> <span m="2074449">that</span> <span m="2074550">it</span> <span m="2075179">performs</span> <span m="2075560">well.</span> </p>
<p><span m="2077540">So</span> <span m="2078080">the</span> <span m="2078250">initial</span> <span m="2078550">condition</span> <span m="2079260">is</span> <span m="2079710">you</span> <span m="2079820">have</span> <span m="2081159">each</span> <span m="2081400">of</span> <span m="2081469">the</span> <span m="2081600">N boys</span> <span m="2082199">has</span> <span m="2082380">an</span> <span m="2082460">ordered</span> <span m="2082840">list</span> <span m="2083909">of</span> <span m="2084100">the</span> <span m="2084250">N</span> <span m="2084409">girls</span> <span m="2085050">and</span> <span m="2085239">vice</span> <span m="2085530">versa,</span> <span m="2087110">and</span> <span m="2087330">the</span> <span m="2087440">ritual,</span> <span m="2088600">we're</span> <span m="2088739">going</span> <span m="2088830">to</span> <span m="2088900">view</span> <span m="2089150">this</span> <span m="2089360">is</span> <span m="2089480">a</span> <span m="2089550">mating</span> <span m="2089929">ritual,</span> <span m="2090460">and</span> <span m="2090580">really,</span> <span m="2090850">the</span> <span m="2091290">program</span> <span m="2091780">is</span> <span m="2091880">doing</span> <span m="2092159">it.</span> <span m="2092250">The</span> <span m="2092330">code</span> <span m="2092580">is</span> <span m="2092639">doing</span> <span m="2092880">it.</span> <span m="2093010">But</span> <span m="2093449">think</span> <span m="2093670">of</span> <span m="2093750">it</span> <span m="2093820">as</span> <span m="2093940">real</span> <span m="2094179">life.</span> <span m="2095060">It</span> <span m="2095219">takes</span> <span m="2095469">place</span> <span m="2095739">over</span> <span m="2095940">several</span> <span m="2096310">days.</span> </p>
<p><span m="2098130">Now,</span> <span m="2099080">the</span> <span m="2099230">day</span> <span m="2099490">is</span> <span m="2099650">broken</span> <span m="2099980">up</span> <span m="2100080">into</span> <span m="2100270">three</span> <span m="2100490">parts--</span> <span m="2100820">the</span> <span m="2100900">morning,</span> <span m="2101260">the</span> <span m="2101380">afternoon,</span> <span m="2101635">and the</span> <span m="2101890">evening.</span> <span m="2102760">In</span> <span m="2103020">the</span> <span m="2103100">morning,</span> <span m="2104160">each</span> <span m="2104440">girl</span> <span m="2104680">comes</span> <span m="2104950">out</span> <span m="2105400">to</span> <span m="2105530">her balcony</span> <span m="2105850">and</span> <span m="2106160">stands</span> <span m="2106530">on</span> <span m="2106600">the balcony.</span> <span m="2108290">Each</span> <span m="2108600">boy</span> <span m="2109730">goes</span> <span m="2110280">to</span> <span m="2110380">the</span> <span m="2110470">balcony</span> <span m="2111170">of</span> <span m="2111350">his</span> <span m="2111580">favorite</span> <span m="2112650">girl</span> <span m="2113990">who</span> <span m="2114190">is</span> <span m="2114300">still</span> <span m="2114600">on</span> <span m="2114740">his</span> <span m="2114870">list</span> <span m="2115280">that</span> <span m="2115340">hasn't</span> <span m="2115690">been</span> <span m="2115820">crossed</span> <span m="2116230">off.</span> </p>
<p><span m="2116830">Now,</span> <span m="2116970">initially,</span> <span m="2117520">every</span> <span m="2117770">girl is</span> <span m="2118000">on</span> <span m="2118100">his</span> <span m="2118210">list.</span> <span m="2118550">So</span> <span m="2118650">he</span> <span m="2118750">goes</span> <span m="2118830">to</span> <span m="2118890">his</span> <span m="2119040">favorite</span> <span m="2119370">girl,</span> <span m="2120090">goes</span> <span m="2120350">under</span> <span m="2120650">her</span> <span m="2120750">balcony,</span> <span m="2121830">and</span> <span m="2122310">serenades</span> <span m="2122990">her.</span> <span m="2124070">Now,</span> <span m="2124540">if,</span> <span m="2124870">over</span> <span m="2125070">the</span> <span m="2125170">course</span> <span m="2125440">of</span> <span m="2125480">the</span> <span m="2125600">algorithm,</span> <span m="2125990">the</span> <span m="2126080">boy</span> <span m="2126390">has</span> <span m="2127230">nobody</span> <span m="2127650">left</span> <span m="2127930">on</span> <span m="2128060">his</span> <span m="2128190">list,</span> <span m="2129590">he's</span> <span m="2129770">out</span> <span m="2129930">of</span> <span m="2129980">luck.</span> <span m="2130470">He</span> <span m="2130590">just</span> <span m="2130750">stays</span> <span m="2131040">home and</span> <span m="2131320">does</span> <span m="2131510">homework.</span> <span m="2132620">All</span> <span m="2132660">right?</span> <span m="2132830">There's</span> <span m="2132980">no</span> <span m="2133130">serenade</span> <span m="2133570">anymore</span> <span m="2133950">for</span> <span m="2134080">him.</span> </p>
<p><span m="2135240">Now,</span> <span m="2135410">in</span> <span m="2135610">the</span> <span m="2135770">afternoon,</span> <span m="2137620">the</span> <span m="2137750">girls</span> <span m="2138190">who</span> <span m="2138320">have</span> <span m="2138460">at</span> <span m="2138550">least</span> <span m="2138840">one</span> <span m="2139300">suitor--</span> <span m="2139980">a</span> <span m="2140080">boy</span> <span m="2140320">down</span> <span m="2140560">there</span> <span m="2140900">serenading</span> <span m="2141420">her--</span> <span m="2142780">looks</span> <span m="2143130">at</span> <span m="2143200">all</span> <span m="2143370">the</span> <span m="2143470">suitors,</span> <span m="2144430">picks her</span> <span m="2144830">favorite,</span> <span m="2146130">and</span> <span m="2146420">to</span> <span m="2146490">the</span> <span m="2146600">favorite</span> <span m="2147010">she</span> <span m="2147130">says,</span> <span m="2147710">maybe</span> <span m="2148280">I'll</span> <span m="2148410">marry</span> <span m="2148800">you.</span> <span m="2149380">Come</span> <span m="2149580">back</span> <span m="2149800">tomorrow.</span> <span m="2151810">Girls</span> <span m="2152190">don't</span> <span m="2152310">want</span> <span m="2152410">to</span> <span m="2152450">make</span> <span m="2152580">it</span> <span m="2152690">too</span> <span m="2152840">easy</span> <span m="2153100">here</span> <span m="2153440">for</span> <span m="2153540">the</span> <span m="2153630">boys.</span> <span m="2154720">Now,</span> <span m="2154910">to</span> <span m="2155010">all</span> <span m="2155330">the</span> <span m="2155440">other</span> <span m="2155590">boys</span> <span m="2156100">who</span> <span m="2156220">are</span> <span m="2156330">lower</span> <span m="2156590">priority</span> <span m="2157070">she</span> <span m="2157220">says,</span> <span m="2157770">I</span> <span m="2157920">will</span> <span m="2158130">never</span> <span m="2158580">marry</span> <span m="2158950">you.</span> <span m="2159670">Go</span> <span m="2159850">away.</span> <span m="2161060">So</span> <span m="2161510">she</span> <span m="2161710">writes</span> <span m="2161900">them</span> <span m="2162050">off for</span> <span m="2162340">good.</span> </p>
<p><span m="2164390">Now,</span> <span m="2164550">that</span> <span m="2164790">night,</span> <span m="2165410">any</span> <span m="2165660">boy</span> <span m="2166060">who</span> <span m="2166190">heard</span> <span m="2166490">a</span> <span m="2166550">no--</span> <span m="2167870">like</span> <span m="2168010">the</span> <span m="2168080">girl</span> <span m="2168340">said</span> <span m="2168700">no,</span> <span m="2168940">I'll</span> <span m="2169080">never</span> <span m="2169220">marry</span> <span m="2169540">you--</span> <span m="2170350">crosses</span> <span m="2170950">that</span> <span m="2171180">girl</span> <span m="2171450">off</span> <span m="2171660">his</span> <span m="2171820">list.</span> <span m="2172640">Because,</span> <span m="2173250">you</span> <span m="2173340">know,</span> <span m="2174020">it's the</span> <span m="2174140">only</span> <span m="2174300">practical</span> <span m="2174710">thing</span> <span m="2174880">to</span> <span m="2174950">do</span> <span m="2175260">at</span> <span m="2175360">that</span> <span m="2175560">point.</span> <span m="2176730">Now,</span> <span m="2176950">if</span> <span m="2177010">the</span> <span m="2177110">boy</span> <span m="2177410">heard</span> <span m="2177730">the</span> <span m="2177820">maybe</span> <span m="2178280">I'll</span> <span m="2178390">marry</span> <span m="2178730">you,</span> <span m="2179940">well,</span> <span m="2180130">he's</span> <span m="2180320">going</span> <span m="2180420">to</span> <span m="2180460">go</span> <span m="2180620">back</span> <span m="2180860">tomorrow,</span> <span m="2181270">because</span> <span m="2182080">that's</span> <span m="2182340">still</span> <span m="2182580">his</span> <span m="2182840">favorite</span> <span m="2183220">girl</span> <span m="2183520">that's</span> <span m="2183700">not</span> <span m="2183870">crossed</span> <span m="2184230">off.</span> <span m="2184740">So</span> <span m="2184850">he</span> <span m="2184990">goes</span> <span m="2185200">back</span> <span m="2185440">and</span> <span m="2185550">serenades</span> <span m="2186080">her</span> <span m="2186210">again</span> <span m="2186450">the</span> <span m="2186520">next</span> <span m="2186770">day</span> <span m="2187250">in</span> <span m="2187360">the</span> <span m="2187420">hopes</span> <span m="2187760">that</span> <span m="2188300">eventually,</span> <span m="2189090">she'll</span> <span m="2189260">say</span> <span m="2189460">yes.</span> </p>
<p><span m="2190650">Now,</span> <span m="2190940">we</span> <span m="2191100">keep</span> <span m="2191330">doing</span> <span m="2191560">this</span> <span m="2191760">every</span> <span m="2192140">day,</span> <span m="2193220">OK?</span> <span m="2194150">And</span> <span m="2194990">if</span> <span m="2195160">we</span> <span m="2195340">ever</span> <span m="2195710">encounter</span> <span m="2196300">a</span> <span m="2196340">day</span> <span m="2197450">where</span> <span m="2197780">every</span> <span m="2198090">girl</span> <span m="2198430">has,</span> <span m="2198640">at</span> <span m="2198710">most,</span> <span m="2199020">one</span> <span m="2199520">suitor,</span> <span m="2201500">the</span> <span m="2201640">algorithm</span> <span m="2202000">stops,</span> <span m="2203310">and</span> <span m="2203470">then</span> <span m="2203650">every</span> <span m="2203970">girl</span> <span m="2204440">who</span> <span m="2204570">has</span> <span m="2204850">a suitor</span> <span m="2205260">says,</span> <span m="2205520">yes,</span> <span m="2205890">I</span> <span m="2206000">will</span> <span m="2206150">marry you.</span> <span m="2207860">Now,</span> <span m="2208020">if a</span> <span m="2208150">girl</span> <span m="2208320">doesn't</span> <span m="2208560">have</span> <span m="2208660">a</span> <span m="2208720">suitor,</span> <span m="2209470">there's</span> <span m="2209640">no</span> <span m="2209770">one</span> <span m="2209900">to</span> <span m="2209970">marry her.</span> <span m="2211050">We're</span> <span m="2211160">going</span> <span m="2211240">to</span> <span m="2211290">prove</span> <span m="2211530">that</span> <span m="2211770">doesn't</span> <span m="2212020">happen,</span> <span m="2212830">OK?</span> <span m="2213100">But</span> <span m="2213290">determination</span> <span m="2214000">condition</span> <span m="2214420">is,</span> <span m="2215140">you</span> <span m="2215340">no</span> <span m="2215570">longer</span> <span m="2215880">have</span> <span m="2216030">a</span> <span m="2216080">situation</span> <span m="2216660">with</span> <span m="2216790">two</span> <span m="2216960">or</span> <span m="2217000">more</span> <span m="2217190">boys</span> <span m="2217570">under</span> <span m="2217800">one</span> <span m="2218000">balcony.</span> <span m="2219810">OK?</span> </p>
<p><span m="2222120">All</span> <span m="2222240">right,</span> <span m="2222440">so</span> <span m="2222570">let's</span> <span m="2223170">run</span> <span m="2223750">that</span> <span m="2224030">algorithm</span> <span m="2225070">on</span> <span m="2225260">this</span> <span m="2225430">example,</span> <span m="2231240">just</span> <span m="2231460">so</span> <span m="2231540">we</span> <span m="2231630">make</span> <span m="2231790">sure</span> <span m="2231950">we</span> <span m="2232080">understand</span> <span m="2232590">it,</span> <span m="2232680">because</span> <span m="2232840">I'm</span> <span m="2232920">going</span> <span m="2233000">to</span> <span m="2233040">try</span> <span m="2233190">to</span> <span m="2233270">prove</span> <span m="2233530">theorems</span> <span m="2233870">about</span> <span m="2234140">it.</span> <span m="2235350">So</span> <span m="2235960">here</span> <span m="2236220">are</span> <span m="2236260">the</span> <span m="2236380">serenades</span> <span m="2237160">that are</span> <span m="2237270">going</span> <span m="2237630">on,</span> <span m="2240390">and</span> <span m="2240740">here's</span> <span m="2241160">the</span> <span m="2241610">girls,</span> <span m="2244300">and</span> <span m="2244580">the</span> <span m="2244650">days.</span> <span m="2246140">It's</span> <span m="2246210">going</span> <span m="2246320">to</span> <span m="2246420">work</span> <span m="2246680">over</span> <span m="2246850">four</span> <span m="2247130">days</span> <span m="2248140">in</span> <span m="2248210">this</span> <span m="2248370">case.</span> <span m="2255280">And</span> <span m="2255520">then</span> <span m="2255660">we're</span> <span m="2255760">also</span> <span m="2256030">going</span> <span m="2256140">to</span> <span m="2256210">keep</span> <span m="2256400">track</span> <span m="2256790">of</span> <span m="2257240">the</span> <span m="2259560">boy's</span> <span m="2259970">lists--</span> <span m="2260450">who's</span> <span m="2260740">gotten</span> <span m="2260990">crossed</span> <span m="2261420">off.</span> </p>
<p><span m="2272180">All</span> <span m="2272300">right,</span> <span m="2272480">so</span> <span m="2272580">these</span> <span m="2272800">will</span> <span m="2272870">be</span> <span m="2272930">the</span> <span m="2273040">cross</span> <span m="2273355">outs</span> <span m="2273670">down</span> <span m="2273890">here.</span> <span m="2275020">Actually,</span> <span m="2275470">maybe</span> <span m="2275550">I'll fit</span> <span m="2275940">it</span> <span m="2276000">up here</span> <span m="2276491">if I can.</span> <span m="2282390">Girls,</span> <span m="2282800">let's</span> <span m="2282860">see,</span> <span m="2283213">A,</span> <span m="2283920">B--</span> <span m="2285300">no, I'm going to have to</span> <span m="2285670">space</span> <span m="2286040">it out.</span> <span m="2295900">And the</span> <span m="2296130">boys</span> <span m="2296780">have</span> <span m="2296960">their</span> <span m="2297100">lists</span> <span m="2297480">here,</span> <span m="2298880">and</span> <span m="2299000">we</span> <span m="2299080">have</span> <span m="2299200">boys</span> <span m="2299520">1,</span> <span m="2299890">2,</span> <span m="2300240">3,</span> <span m="2300770">4,</span> <span m="2301170">5.</span> <span m="2302050">And</span> <span m="2302200">here</span> <span m="2302470">I'm</span> <span m="2302560">going</span> <span m="2302660">to</span> <span m="2302710">record</span> <span m="2303160">the</span> <span m="2303240">cross</span> <span m="2303630">outs.</span> </p>
<p><span m="2308980">All</span> <span m="2309170">right,</span> <span m="2309370">so</span> <span m="2309480">let's</span> <span m="2310350">look</span> <span m="2310580">at</span> <span m="2310700">day</span> <span m="2310930">one.</span> <span m="2314300">Who</span> <span m="2314670">is</span> <span m="2314860">under</span> <span m="2315510">girl</span> <span m="2315910">A's</span> <span m="2316290">balcony</span> <span m="2316850">on</span> <span m="2317010">day</span> <span m="2317210">one?</span> </p>
<p><span m="2319898">AUDIENCE: 2,</span> <span m="2320346">4, and 5?</span> </p>
<p><span m="2320794">PROFESSOR: 2,</span> <span m="2321250">4,</span> <span m="2321600">and</span> <span m="2321710">5--</span> <span m="2322160">each</span> <span m="2322430">like</span> <span m="2322650">girl A</span> <span m="2323010">the</span> <span m="2323130">best,</span> <span m="2323480">so</span> <span m="2323650">she's</span> <span m="2323900">got</span> <span m="2324050">a</span> <span m="2324100">lot</span> <span m="2324310">of</span> <span m="2324390">activity.</span> <span m="2325800">These</span> <span m="2326030">three</span> <span m="2326250">boys</span> <span m="2326560">show</span> <span m="2326790">up.</span> <span m="2327900">Anybody</span> <span m="2328350">under</span> <span m="2329330">girl B's</span> <span m="2329760">balcony?</span> <span m="2331470">No,</span> <span m="2331660">nope,</span> <span m="2331990">no,</span> <span m="2332230">nothing</span> <span m="2332510">there.</span> </p>
<p><span m="2334380">C,</span> <span m="2336430">does</span> <span m="2336570">C</span> <span m="2336910">have</span> <span m="2337010">anybody?</span> <span m="2338370">Boy</span> <span m="2338600">1,</span> <span m="2339040">yeah.</span> <span m="2339450">D?</span> <span m="2341600">3,</span> <span m="2342650">and</span> <span m="2342960">E,</span> <span m="2344660">I</span> <span m="2344910">don't</span> <span m="2345090">think</span> <span m="2345230">there's</span> <span m="2345380">any</span> <span m="2345560">action,</span> <span m="2345950">right?</span> <span m="2346850">Nope.</span> </p>
<p><span m="2347966">All</span> <span m="2348350">right,</span> <span m="2348570">so</span> <span m="2348650">that's</span> <span m="2348920">the</span> <span m="2349020">status</span> <span m="2349750">on</span> <span m="2350080">day</span> <span m="2350340">one.</span> <span m="2352220">So</span> <span m="2353460">the</span> <span m="2353610">action is</span> <span m="2354040">all</span> <span m="2354250">up</span> <span m="2354410">here.</span> <span m="2355732">All</span> <span m="2356170">right,</span> <span m="2356470">so</span> <span m="2356610">what</span> <span m="2356830">does</span> <span m="2357010">girl</span> <span m="2357400">A</span> <span m="2357770">do?</span> <span m="2359670">Who</span> <span m="2359880">does</span> <span m="2359980">she</span> <span m="2360240">tell</span> <span m="2360560">to</span> <span m="2360640">hang</span> <span m="2360870">around?</span> </p>
<p><span m="2361713">AUDIENCE: Number</span> <span m="2362096">5.</span> </p>
<p><span m="2363040">PROFESSOR: Number</span> <span m="2363260">5,</span> <span m="2363740">yes.</span> <span m="2363920">She's</span> <span m="2364020">got</span> <span m="2364190">5,</span> <span m="2364560">4,</span> <span m="2364850">and</span> <span m="2364950">2,</span> <span m="2365150">and</span> <span m="2365260">she</span> <span m="2365400">likes</span> <span m="2365710">5</span> <span m="2366040">the</span> <span m="2366130">best.</span> <span m="2367210">She</span> <span m="2367410">tells</span> <span m="2367660">5</span> <span m="2368010">to</span> <span m="2368090">come</span> <span m="2368300">back,</span> <span m="2368770">and</span> <span m="2368970">she</span> <span m="2369520">says</span> <span m="2369820">to</span> <span m="2369890">these</span> <span m="2370110">guys,</span> <span m="2370330">we're</span> <span m="2370410">not</span> <span m="2370590">going</span> <span m="2370680">to</span> <span m="2370730">marry him.</span> <span m="2372180">That</span> <span m="2372420">means</span> <span m="2372790">that</span> <span m="2373070">boys</span> <span m="2373520">2</span> <span m="2373760">and</span> <span m="2373930">4</span> <span m="2375190">cross</span> <span m="2375790">girl</span> <span m="2376170">A</span> <span m="2376510">off</span> <span m="2376820">their</span> <span m="2376990">list.</span> <span m="2378710">So</span> <span m="2378990">they</span> <span m="2379560">say</span> <span m="2380150">A</span> <span m="2380340">is</span> <span m="2380510">no</span> <span m="2380710">longer</span> <span m="2381020">possible</span> <span m="2381600">for</span> <span m="2381740">them.</span> </p>
<p><span m="2383445">All</span> <span m="2383910">right,</span> <span m="2384120">now</span> <span m="2384300">we</span> <span m="2384400">go</span> <span m="2384520">to</span> <span m="2384630">day</span> <span m="2384900">two,</span> <span m="2386780">and</span> <span m="2387770">5</span> <span m="2388180">goes</span> <span m="2388400">back</span> <span m="2388610">to</span> <span m="2388700">girl</span> <span m="2389000">A, and,</span> <span m="2389270">of</span> <span m="2389340">course,</span> <span m="2389980">boys</span> <span m="2390370">1</span> <span m="2390550">and</span> <span m="2390660">3</span> <span m="2390870">stay</span> <span m="2391140">there.</span> <span m="2391760">Where</span> <span m="2392025">does</span> <span m="2392290">boy</span> <span m="2392520">2</span> <span m="2392830">go</span> <span m="2393460">on</span> <span m="2393630">day</span> <span m="2393820">two?</span> <span m="2396030">B.</span> </p>
<p><span m="2397330">All</span> <span m="2397470">right,</span> <span m="2397670">so</span> <span m="2397760">boy</span> <span m="2398040">2</span> <span m="2398260">shows</span> <span m="2398610">up</span> <span m="2398780">here</span> <span m="2399770">on</span> <span m="2399960">day</span> <span m="2400160">two,</span> <span m="2401462">and,</span> <span m="2401860">let's</span> <span m="2402160">see,</span> <span m="2402280">boy</span> <span m="2402570">5</span> <span m="2402940">is</span> <span m="2403070">already</span> <span m="2403340">there,</span> <span m="2404900">and</span> <span m="2405040">then</span> <span m="2405160">we've</span> <span m="2405250">got</span> <span m="2405400">to</span> <span m="2405450">get</span> <span m="2405710">boy</span> <span m="2406090">4.</span> <span m="2406545">Where</span> <span m="2407000">does</span> <span m="2407090">he</span> <span m="2407280">go</span> <span m="2407440">now?</span> <span m="2408860">C.</span> <span m="2409810">All  right,</span> <span m="2410070">boy</span> <span m="2410380">4</span> <span m="2411350">shows</span> <span m="2411700">up</span> <span m="2411870">here.</span> <span m="2414160">All</span> <span m="2414260">right,</span> <span m="2414420">so</span> <span m="2414510">now</span> <span m="2414870">the</span> <span m="2415030">action</span> <span m="2415440">is</span> <span m="2415740">with</span> <span m="2415950">girl</span> <span m="2416260">C.</span> <span m="2418580">And</span> <span m="2418980">what</span> <span m="2419090">does</span> <span m="2419180">she</span> <span m="2419400">do?</span> </p>
<p><span m="2420233">AUDIENCE:</span> <span m="2420656">[INAUDIBLE]</span> </p>
<p><span m="2422690">PROFESSOR: Yeah,</span> <span m="2423030">she</span> <span m="2423360">keeps</span> <span m="2423720">4,</span> <span m="2424700">and</span> <span m="2424850">she</span> <span m="2425000">boots</span> <span m="2425430">poor</span> <span m="2425810">1.</span> <span m="2426320">You know,</span> <span m="2426430">led</span> <span m="2426590">him</span> <span m="2426700">along</span> <span m="2427110">for</span> <span m="2427230">a</span> <span m="2427290">day,</span> <span m="2428180">and</span> <span m="2428350">then</span> <span m="2428490">he</span> <span m="2428550">gets</span> <span m="2428760">the</span> <span m="2428840">boot</span> <span m="2429080">because</span> <span m="2429280">boy</span> <span m="2429500">4</span> <span m="2429820">showed</span> <span m="2430130">up,</span> <span m="2430320">right?</span> <span m="2431520">Because</span> <span m="2431820">girl</span> <span m="2432160">C</span> <span m="2433150">likes</span> <span m="2433730">4</span> <span m="2434160">better</span> <span m="2434420">than</span> <span m="2434600">1,</span> <span m="2435760">so</span> <span m="2436130">bad</span> <span m="2436400">luck</span> <span m="2436910">for</span> <span m="2437060">1</span> <span m="2437340">there.</span> <span m="2438450">So</span> <span m="2438690">now</span> <span m="2439170">one</span> <span m="2439560">goes</span> <span m="2439870">home</span> <span m="2440750">that</span> <span m="2441000">night</span> <span m="2441640">and</span> <span m="2441850">crosses</span> <span m="2442420">off</span> <span m="2443520">girl</span> <span m="2444070">C.</span> </p>
<p><span m="2446370">OK.</span> <span m="2448100">All</span> <span m="2448340">right,</span> <span m="2448620">and</span> <span m="2448790">where</span> <span m="2448960">does</span> <span m="2449120">1</span> <span m="2449450">go</span> <span m="2449650">on</span> <span m="2449850">day</span> <span m="2450070">three?</span> <span m="2452340">All</span> <span m="2452476">right,</span> <span m="2452613">so</span> <span m="2452750">he</span> <span m="2452810">goes</span> <span m="2453130">to--</span> <span m="2453460">he crossed off</span> <span m="2453840">C--</span> <span m="2454310">he goes</span> <span m="2454470">to</span> <span m="2454560">B.</span> <span m="2457020">All</span> <span m="2457120">right,</span> <span m="2457320">so</span> <span m="2457630">this</span> <span m="2457840">is</span> <span m="2457960">left</span> <span m="2458230">over.</span> <span m="2458500">We</span> <span m="2458620">have</span> <span m="2458820">5,</span> <span m="2459700">2,</span> <span m="2460580">4,</span> <span m="2461068">3--</span> <span m="2462044">boy</span> <span m="2462532">1</span> <span m="2463020">now</span> <span m="2463290">goes</span> <span m="2463700">to</span> <span m="2464850">B,</span> <span m="2465210">right?</span> <span m="2467820">OK.</span> </p>
<p><span m="2470610">And</span> <span m="2470810">then</span> <span m="2470980">what</span> <span m="2471160">does</span> <span m="2471320">girl</span> <span m="2471580">B</span> <span m="2471840">do?</span> <span m="2473090">Who does</span> <span m="2473280">she</span> <span m="2473480">keep</span> <span m="2473690">around?</span> <span m="2476030">Keeps</span> <span m="2476410">2,</span> <span m="2477990">boots</span> <span m="2478370">poor</span> <span m="2478630">1.</span> <span m="2480580">All</span> <span m="2480720">right,</span> <span m="2480900">so</span> <span m="2481040">1</span> <span m="2481300">says,</span> <span m="2481600">all</span> <span m="2481770">right,</span> <span m="2482080">I'm</span> <span m="2482230">crossing</span> <span m="2482690">B</span> <span m="2482890">off</span> <span m="2483030">my</span> <span m="2483190">list,</span> <span m="2484130">got</span> <span m="2484330">the</span> <span m="2484410">message.</span> <span m="2486370">And</span> <span m="2486520">now</span> <span m="2486780">where</span> <span m="2486980">does</span> <span m="2487090">boy</span> <span m="2487300">1</span> <span m="2487620">go</span> <span m="2487770">on</span> <span m="2487920">day</span> <span m="2488110">four?</span> </p>
<p><span m="2488670">AUDIENCE: Girl</span> <span m="2489140">E?</span> </p>
<p><span m="2490080">PROFESSOR: E--</span> <span m="2490670">third</span> <span m="2490940">choice.</span> <span m="2491440">OK.</span> <span m="2492470">So</span> <span m="2493220">1</span> <span m="2493620">shows</span> <span m="2493920">up</span> <span m="2494070">down</span> <span m="2494350">here,</span> <span m="2495340">and</span> <span m="2495460">these</span> <span m="2495680">guys</span> <span m="2495930">keep</span> <span m="2496130">returning.</span> <span m="2498200">Wow, so</span> <span m="2498600">on</span> <span m="2498790">day</span> <span m="2499070">four</span> <span m="2501380">there's</span> <span m="2501600">no</span> <span m="2501730">more</span> <span m="2501940">fighting.</span> <span m="2502660">Every</span> <span m="2502940">girl</span> <span m="2503220">has</span> <span m="2503450">at</span> <span m="2503500">most</span> <span m="2503850">one.</span> <span m="2504700">The</span> <span m="2504810">termination</span> <span m="2505430">condition</span> <span m="2505860">is</span> <span m="2506130">invoked,</span> <span m="2507110">and</span> <span m="2507260">these</span> <span m="2507490">are</span> <span m="2507520">the</span> <span m="2507610">marriages</span> <span m="2508150">that</span> <span m="2508270">take</span> <span m="2508490">place.</span> <span m="2509490">The</span> <span m="2509590">girls</span> <span m="2509850">say</span> <span m="2510050">yes.</span> <span m="2513750">All</span> <span m="2513920">right,</span> <span m="2514220">now</span> <span m="2514380">is</span> <span m="2514470">everybody--</span> </p>
<p><span m="2514920">[LAUGHTER]</span> </p>
<p><span m="2516720">--does</span> <span m="2516890">everybody</span> <span m="2518080">understand</span> <span m="2518660">the</span> <span m="2518810">algorithm</span> <span m="2519260">we</span> <span m="2519400">used?</span> <span m="2520140">Any</span> <span m="2520330">questions</span> <span m="2520760">on</span> <span m="2520890">the</span> <span m="2521020">algorithm?</span> <span m="2524120">Yeah?</span> </p>
<p><span m="2524525">AUDIENCE:</span> <span m="2524930">[INAUDIBLE]</span> <span m="2525403">the first case</span> <span m="2525876">[INAUDIBLE]</span> <span m="2527768">or is that just</span> <span m="2528241">in case</span> <span m="2528714">the</span> <span m="2529187">[INAUDIBLE]</span> </p>
<p><span m="2531080">PROFESSOR: That's</span> <span m="2531330">in</span> <span m="2531450">case</span> <span m="2531900">the algorithm</span> <span m="2532800">doesn't</span> <span m="2533060">work.</span> <span m="2534120">Because</span> <span m="2534280">we</span> <span m="2534370">haven't</span> <span m="2534480">proved</span> <span m="2534970">it</span> <span m="2535070">works</span> <span m="2535340">yet,</span> <span m="2535570">and</span> <span m="2535670">I</span> <span m="2535710">gotta</span> <span m="2535950">have</span> <span m="2536750">a</span> <span m="2536840">possibility</span> <span m="2537640">for,</span> <span m="2538830">a</span> <span m="2538930">boy</span> <span m="2539150">crosses</span> <span m="2539620">every</span> <span m="2539830">girl</span> <span m="2540080">off his</span> <span m="2540410">list,</span> <span m="2540560">he</span> <span m="2540710">gets</span> <span m="2540910">rejected</span> <span m="2541340">everywhere.</span> <span m="2542340">That</span> <span m="2542550">is</span> <span m="2542760">a</span> <span m="2542820">possibility,</span> <span m="2543430">so</span> <span m="2543530">I've</span> <span m="2543590">got</span> <span m="2543690">to</span> <span m="2543760">say</span> <span m="2543940">what</span> <span m="2544120">would</span> <span m="2544230">happen</span> <span m="2544900">in</span> <span m="2545050">that</span> <span m="2545210">possibility.</span> <span m="2546150">Now,</span> <span m="2546300">we</span> <span m="2546410">will</span> <span m="2546570">prove</span> <span m="2546900">in</span> <span m="2546980">a</span> <span m="2547030">few</span> <span m="2547210">minutes</span> <span m="2548250">that</span> <span m="2548500">condition</span> <span m="2548910">never</span> <span m="2549180">arises,</span> <span m="2550960">OK?</span> <span m="2552430">But</span> <span m="2552590">I'm</span> <span m="2552670">giving</span> <span m="2552910">you</span> <span m="2553050">what</span> <span m="2553290">might</span> <span m="2553500">happen,</span> <span m="2554080">in</span> <span m="2554180">which</span> <span m="2554350">so</span> <span m="2554530">it</span> <span m="2554610">never</span> <span m="2554850">does,</span> <span m="2555200">so</span> <span m="2555840">no</span> <span m="2556010">boy</span> <span m="2556280">ends</span> <span m="2556480">up</span> <span m="2556580">having</span> <span m="2556830">to</span> <span m="2557110">stay</span> <span m="2557290">home</span> <span m="2557490">and</span> <span m="2557550">do</span> <span m="2557670">homework</span> <span m="2558010">here.</span> </p>
<p><span m="2559610">All</span> <span m="2559740">right,</span> <span m="2560180">so</span> <span m="2560730">that's</span> <span m="2561010">the</span> <span m="2561170">algorithm.</span> <span m="2562100">Now</span> <span m="2562920">let's</span> <span m="2563010">see</span> <span m="2563240">if</span> <span m="2563340">we</span> <span m="2563430">can</span> <span m="2563600">see</span> <span m="2563770">if</span> <span m="2563870">there's</span> <span m="2563970">any</span> <span m="2564110">rogue</span> <span m="2564360">couples.</span> <span m="2566770">All</span> <span m="2566910">right,</span> <span m="2567170">so,</span> <span m="2567320">for</span> <span m="2567440">example,</span> <span m="2568600">let's</span> <span m="2568910">look</span> <span m="2569150">at</span> <span m="2570370">boy</span> <span m="2570610">1.</span> <span m="2572920">Boy</span> <span m="2573180">1</span> <span m="2573610">got</span> <span m="2573850">paired</span> <span m="2574160">to</span> <span m="2574310">his</span> <span m="2574520">third</span> <span m="2574850">choice,</span> <span m="2575560">E,</span> <span m="2576990">so</span> <span m="2577210">1, C</span> <span m="2578220">might be</span> <span m="2578610">a rogue</span> <span m="2579110">couple.</span> <span m="2581260">Is</span> <span m="2581370">that</span> <span m="2581570">possible?</span> </p>
<p><span m="2584100">No, because</span> <span m="2584490">C</span> <span m="2585210">got</span> <span m="2585530">4</span> <span m="2586110">here,</span> <span m="2587390">which</span> <span m="2587560">is</span> <span m="2587680">her</span> <span m="2587860">first</span> <span m="2588200">choice.</span> <span m="2588590">She's</span> <span m="2588670">not</span> <span m="2588910">going</span> <span m="2589190">with</span> <span m="2589440">boy</span> <span m="2589630">1.</span> <span m="2590250">That's</span> <span m="2590520">not</span> <span m="2590710">working.</span> </p>
<p><span m="2591450">What</span> <span m="2591690">about</span> <span m="2591950">1, B?</span> <span m="2594190">Could</span> <span m="2594340">that</span> <span m="2594510">be</span> <span m="2594630">rogue?</span> <span m="2596470">No,</span> <span m="2596930">B</span> <span m="2597260">got</span> <span m="2597640">2,</span> <span m="2599360">and</span> <span m="2599560">B</span> <span m="2599860">likes</span> <span m="2600290">2</span> <span m="2600610">better</span> <span m="2600920">than</span> <span m="2601090">1,</span> <span m="2602570">so</span> <span m="2602950">1, C</span> <span m="2603450">and</span> <span m="2603670">1, B</span> <span m="2603820">are</span> <span m="2603880">not</span> <span m="2604150">rogue.</span> <span m="2604510">And</span> <span m="2604640">1</span> <span m="2604850">got</span> <span m="2605040">E,</span> <span m="2605360">so</span> <span m="2605900">there's</span> <span m="2606330">no</span> <span m="2606450">other</span> <span m="2606600">possibility</span> <span m="2607150">for</span> <span m="2607250">boy</span> <span m="2607460">1,</span> <span m="2607810">so</span> <span m="2607870">boy</span> <span m="2608100">1</span> <span m="2608390">is</span> <span m="2608510">not</span> <span m="2608860">in</span> <span m="2608960">a</span> <span m="2609020">rogue</span> <span m="2609250">couple.</span> </p>
<p><span m="2610840">What</span> <span m="2611030">about</span> <span m="2611490">boy</span> <span m="2611860">2?</span> <span m="2613342">2</span> <span m="2613836">got</span> <span m="2614330">B,</span> <span m="2617160">and</span> <span m="2617340">that's</span> <span m="2617940">2's</span> <span m="2618340">second</span> <span m="2618920">choice.</span> <span m="2619410">What</span> <span m="2619570">about</span> <span m="2619920">2, A?</span> <span m="2623860">Let's</span> <span m="2624070">see,</span> <span m="2624620">A</span> <span m="2624900">got</span> <span m="2625210">5,</span> <span m="2627550">and</span> <span m="2628240">A</span> <span m="2628570">likes</span> <span m="2628940">5</span> <span m="2629620">better</span> <span m="2630040">than</span> <span m="2630250">2,</span> <span m="2632180">so</span> <span m="2632450">that's</span> <span m="2632720">not</span> <span m="2632940">rogue.</span> <span m="2633240">Boy</span> <span m="2633440">2</span> <span m="2633670">is</span> <span m="2633790">not</span> <span m="2633990">rogue.</span> </p>
<p><span m="2635710">All</span> <span m="2636160">right,</span> <span m="2637240">boy</span> <span m="2637480">3--</span> <span m="2640540">boy</span> <span m="2640780">3</span> <span m="2641176">got</span> <span m="2641572">his</span> <span m="2641970">first</span> <span m="2642230">choice,</span> <span m="2642590">right?</span> <span m="2644840">3</span> <span m="2645276">got</span> <span m="2645712">D,</span> <span m="2646850">so</span> <span m="2647260">3</span> <span m="2647460">is</span> <span m="2647550">not</span> <span m="2647770">going</span> <span m="2647990">anywhere.</span> <span m="2649720">Boy</span> <span m="2650160">4</span> <span m="2650840">got--</span> <span m="2652410">who</span> <span m="2652880">did</span> <span m="2653100">boy</span> <span m="2653300">4</span> <span m="2653600">get--</span> <span m="2653865">got</span> <span m="2654130">C.</span> <span m="2657820">4</span> <span m="2658060">got</span> <span m="2658230">his</span> <span m="2658290">second</span> <span m="2658720">choice.</span> </p>
<p><span m="2659070">What</span> <span m="2659180">about</span> <span m="2659450">4, A?</span> <span m="2663370">A</span> <span m="2663590">hates</span> <span m="2663970">4.</span> <span m="2665040">A is</span> <span m="2665250">not</span> <span m="2665880">gonna</span> <span m="2666130">get</span> <span m="2666530">caught</span> <span m="2666810">dead</span> <span m="2667020">with</span> <span m="2667170">4,</span> <span m="2667460">so</span> <span m="2667570">that's</span> <span m="2667780">not</span> <span m="2667990">rogue.</span> <span m="2668760">So</span> <span m="2668940">4 is</span> <span m="2669330">OK.</span> <span m="2669880">4 is</span> <span m="2670160">not in a</span> <span m="2670340">rogue</span> <span m="2670590">couple.</span> </p>
<p><span m="2670890">And</span> <span m="2670990">finally,</span> <span m="2671950">boy</span> <span m="2672260">5--</span> <span m="2674530">boy</span> <span m="2674730">5</span> <span m="2675230">is</span> <span m="2675360">paired</span> <span m="2675740">with</span> <span m="2675960">A,</span> <span m="2677295">and</span> <span m="2677740">that</span> <span m="2677930">is</span> <span m="2678080">boy</span> <span m="2678310">5's</span> <span m="2679310">first</span> <span m="2679740">choice,</span> <span m="2680260">so</span> <span m="2680380">he's</span> <span m="2680660">not</span> <span m="2680980">wandering</span> <span m="2681370">off</span> <span m="2681620">here.</span> <span m="2682940">All</span> <span m="2683050">right?</span> <span m="2683260">So</span> <span m="2683380">in</span> <span m="2683480">fact,</span> <span m="2684030">we've</span> <span m="2684170">just</span> <span m="2684390">argued</span> <span m="2685620">that</span> <span m="2685830">this</span> <span m="2686060">is</span> <span m="2686270">a</span> <span m="2686360">stable</span> <span m="2688530">set of</span> <span m="2688670">marriages,</span> <span m="2689080">a</span> <span m="2689200">stable</span> <span m="2689500">matching</span> <span m="2690540">in</span> <span m="2690730">this</span> <span m="2690900">case.</span> <span m="2692720">Any</span> <span m="2692870">questions</span> <span m="2693400">now</span> <span m="2693650">about</span> <span m="2693820">what</span> <span m="2693950">we're</span> <span m="2694050">trying</span> <span m="2694320">to</span> <span m="2694390">do?</span> </p>
<p><span m="2696770">OK,</span> <span m="2697000">because we're going to</span> <span m="2697300">try</span> <span m="2697450">to</span> <span m="2697520">show</span> <span m="2697860">now</span> <span m="2698100">it</span> <span m="2698260">always</span> <span m="2699060">produces</span> <span m="2699640">a</span> <span m="2699690">stable</span> <span m="2700000">matching.</span> <span m="2702040">And</span> <span m="2702280">to</span> <span m="2702360">do</span> <span m="2702580">that,</span> <span m="2702900">we</span> <span m="2703010">need</span> <span m="2704736">to</span> <span m="2705150">do</span> <span m="2705300">a</span> <span m="2705400">few</span> <span m="2705540">things.</span> <span m="2716580">All</span> <span m="2716700">right,</span> <span m="2716880">so</span> <span m="2717220">what</span> <span m="2717410">are</span> <span m="2717440">the</span> <span m="2717530">things</span> <span m="2717730">we</span> <span m="2717840">need</span> <span m="2718010">to</span> <span m="2718070">show</span> <span m="2719820">to</span> <span m="2719920">prove</span> <span m="2720140">everything</span> <span m="2720450">is</span> <span m="2720580">going</span> <span m="2720680">to</span> <span m="2720730">be</span> <span m="2720840">good</span> <span m="2721060">here?</span> <span m="2723420">What</span> <span m="2723710">are</span> <span m="2723790">some</span> <span m="2723940">facts</span> <span m="2724240">we</span> <span m="2724320">to</span> <span m="2724470">prove?</span> <span m="2724690">Yeah?</span> </p>
<p><span m="2725462">AUDIENCE: Don't we need</span> <span m="2725914">to show</span> <span m="2726366">that</span> <span m="2727270">the</span> <span m="2727722">algorithm,</span> <span m="2728180">it</span> <span m="2728230">does come</span> <span m="2728600">to an end?</span> </p>
<p><span m="2729340">PROFESSOR: Yes.</span> </p>
<p><span m="2729670">[LAUGHTER]</span> </p>
<p></p>
<p><span m="2730750">The</span> <span m="2730940">algorithm</span> <span m="2731400">terminates,</span> <span m="2733280">so</span> <span m="2733420">we</span> <span m="2733490">need</span> <span m="2733650">to</span> <span m="2733700">show</span> <span m="2734000">that</span> <span m="2734530">the</span> <span m="2734650">marriage</span> <span m="2735070">algorithm,</span> <span m="2735420">TMA,</span> <span m="2736490">terminates.</span> <span m="2739080">Otherwise,</span> <span m="2739910">the</span> <span m="2740040">boys</span> <span m="2740360">are</span> <span m="2740450">serenading</span> <span m="2741060">forever,</span> <span m="2741490">and</span> <span m="2741890">that's</span> <span m="2742210">not</span> <span m="2742380">too</span> <span m="2742490">good.</span> <span m="2744360">All right,</span> <span m="2744540">what</span> <span m="2744710">else</span> <span m="2744920">do</span> <span m="2745000">we</span> <span m="2745110">want</span> <span m="2745290">to</span> <span m="2745330">show?</span> <span m="2746100">Yeah?</span> </p>
<p><span m="2747055">AUDIENCE: If it</span> <span m="2747510">does terminate,</span> <span m="2747965">then</span> <span m="2748420">one is</span> <span m="2748875">left empty.</span> </p>
<p><span m="2750240">PROFESSOR: Then?</span> </p>
<p><span m="2750575">AUDIENCE: Everyone</span> <span m="2750910">gets</span> <span m="2751330">someone.</span> </p>
<p><span m="2752170">PROFESSOR: Everyone</span> <span m="2753500">gets</span> <span m="2753820">married.</span> <span m="2756790">Yep.</span> <span m="2759700">Stability</span> <span m="2760180">is</span> <span m="2760290">easy</span> <span m="2760610">if</span> <span m="2760710">nobody</span> <span m="2761000">gets</span> <span m="2761190">married.</span> <span m="2765820">All</span> <span m="2766010">right,</span> <span m="2766380">what</span> <span m="2766630">else</span> <span m="2766860">do</span> <span m="2766940">we</span> <span m="2767010">want</span> <span m="2767210">to</span> <span m="2767260">show</span> <span m="2767540">here?</span> <span m="2767910">Yeah?</span> </p>
<p><span m="2768185">AUDIENCE: There are</span> <span m="2768460">no rogue</span> <span m="2768925">couples.</span> </p>
<p><span m="2769390">PROFESSOR: No</span> <span m="2769930">rogue</span> <span m="2770240">couples.</span> <span m="2779000">All</span> <span m="2779180">right,</span> <span m="2779420">what</span> <span m="2779670">else</span> <span m="2779900">might</span> <span m="2780150">we</span> <span m="2780270">like</span> <span m="2780450">to</span> <span m="2780540">show?</span> <span m="2782280">These</span> <span m="2782480">are</span> <span m="2782520">the</span> <span m="2782640">three</span> <span m="2782890">main</span> <span m="2783200">ones.</span> <span m="2783710">There's</span> <span m="2784290">a couple of</span> <span m="2784440">other</span> <span m="2784630">things</span> <span m="2784800">you</span> <span m="2784860">might</span> <span m="2784990">like.</span> <span m="2785230">Yeah?</span> </p>
<p><span m="2785668">AUDIENCE: It runs quickly.</span> </p>
<p><span m="2786544">PROFESSOR: It runs</span> <span m="2786982">quickly.</span> <span m="2788740">Well,</span> <span m="2788860">you can only</span> <span m="2789180">serenade</span> <span m="2789690">for</span> <span m="2789820">so</span> <span m="2790030">long.</span> <span m="2795380">In</span> <span m="2795470">fact,</span> <span m="2795770">it</span> <span m="2795830">does</span> <span m="2796080">run</span> <span m="2796290">quickly,</span> <span m="2796465">and</span> <span m="2796640">that's</span> <span m="2796840">why</span> <span m="2797000">it's</span> <span m="2797080">useful</span> <span m="2797390">in</span> <span m="2797450">practice.</span> <span m="2798850">Anything</span> <span m="2799220">else</span> <span m="2799450">you</span> <span m="2799560">might</span> <span m="2799810">want</span> <span m="2799940">to</span> <span m="2799990">show</span> <span m="2800190">about</span> <span m="2800440">this</span> <span m="2800620">algorithm?</span> </p>
<p><span m="2801992">AUDIENCE: How many people</span> <span m="2802433">you crossed</span> <span m="2802874">out?</span> </p>
<p><span m="2803756">PROFESSOR: How many</span> <span m="2804200">people</span> <span m="2804485">you</span> <span m="2804770">crossed</span> <span m="2805120">out--</span> <span m="2806140">yeah,</span> <span m="2806190">you</span> <span m="2806310">could,</span> <span m="2806610">and</span> <span m="2806680">that'll</span> <span m="2806920">tie</span> <span m="2807250">into</span> <span m="2807700">how</span> <span m="2807840">long</span> <span m="2808030">it</span> <span m="2808130">takes.</span> <span m="2809370">Yeah.</span> <span m="2811400">Anything</span> <span m="2811600">else?</span> <span m="2811850">Yeah?</span> </p>
<p><span m="2812190">AUDIENCE: The</span> <span m="2812605">average</span> <span m="2815416">likeness</span> <span m="2817286">between the</span> <span m="2817758">couples.</span> </p>
<p><span m="2818230">PROFESSOR: The</span> <span m="2818702">average</span> <span m="2819180">likeness,</span> <span m="2819600">oh.</span> <span m="2819970">So</span> <span m="2820935">yeah,</span> <span m="2821300">we</span> <span m="2821400">haven't</span> <span m="2822080">had</span> <span m="2822380">a</span> <span m="2822410">notion</span> <span m="2822880">here of</span> <span m="2823090">how</span> <span m="2823280">happy</span> <span m="2823680">people</span> <span m="2824020">are</span> <span m="2825090">at</span> <span m="2825260">the</span> <span m="2825440">end,</span> <span m="2825610">because</span> <span m="2825740">we</span> <span m="2825810">don't</span> <span m="2825990">have</span> <span m="2826150">a</span> <span m="2826240">weighting</span> <span m="2826610">on</span> <span m="2826730">the</span> <span m="2826880">edges,</span> <span m="2827780">but</span> <span m="2827900">you</span> <span m="2827990">might</span> <span m="2828380">want</span> <span m="2828610">to</span> <span m="2828670">think</span> <span m="2828890">about</span> <span m="2829170">that.</span> <span m="2829340">That's</span> <span m="2829540">actually</span> <span m="2829850">a</span> <span m="2829950">good</span> <span m="2830020">point.</span> <span m="2830520">Yeah?</span> </p>
<p><span m="2831567">AUDIENCE: If</span> <span m="2832054">they</span> <span m="2832541">[INAUDIBLE]</span> <span m="2833028">if it matters</span> <span m="2833515">who</span> <span m="2834002">serenades</span> <span m="2834976">[INAUDIBLE]</span> <span m="2835463">girls</span> <span m="2835950">or boys</span> <span m="2836437">to get her.</span> </p>
<p><span m="2837411">PROFESSOR: That's</span> <span m="2837900">a great</span> <span m="2838400">point.</span> <span m="2839120">Is this</span> <span m="2839480">algorithm</span> <span m="2839870">good</span> <span m="2840130">for</span> <span m="2840270">girls,</span> <span m="2840980">or</span> <span m="2841160">good</span> <span m="2841340">for</span> <span m="2841460">boys?</span> <span m="2843360">Yeah,</span> <span m="2843720">that's</span> <span m="2843940">a</span> <span m="2844020">good</span> <span m="2844200">point--</span> <span m="2844540">fairness.</span> <span m="2846760">All</span> <span m="2846890">right,</span> <span m="2847060">so</span> <span m="2847160">we'll</span> <span m="2847310">take</span> <span m="2847470">a</span> <span m="2847530">look</span> <span m="2847720">at</span> <span m="2847810">fairness</span> <span m="2848260">also.</span> <span m="2849910">Is</span> <span m="2850080">it</span> <span m="2850120">better</span> <span m="2850440">to</span> <span m="2850510">be</span> <span m="2850640">a</span> <span m="2850700">serenader,</span> <span m="2851280">or</span> <span m="2851500">be</span> <span m="2851800">on</span> <span m="2851920">the</span> <span m="2852000">balcony</span> <span m="2852460">making</span> <span m="2852760">your</span> <span m="2852900">choices?</span> </p>
<p><span m="2855060">OK,</span> <span m="2855330">so</span> <span m="2855460">this</span> <span m="2855680">is</span> <span m="2855770">what</span> <span m="2855900">we've</span> <span m="2855990">got</span> <span m="2856160">to</span> <span m="2856230">do.</span> <span m="2860030">So</span> <span m="2860210">let's</span> <span m="2860460">start</span> <span m="2860810">by</span> <span m="2860920">showing</span> <span m="2861450">TMA</span> <span m="2861980">terminates,</span> <span m="2862740">and</span> <span m="2862920">that it</span> <span m="2863000">terminates</span> <span m="2863500">pretty quickly.</span> <span m="2873460">Now,</span> <span m="2873770">in</span> <span m="2873870">fact,</span> <span m="2874230">I'm</span> <span m="2874330">going</span> <span m="2874430">to</span> <span m="2874530">prove</span> <span m="2874620">a</span> <span m="2874690">fairly</span> <span m="2875070">crude</span> <span m="2875490">bound</span> <span m="2875860">on</span> <span m="2875950">the</span> <span m="2876050">time,</span> <span m="2877700">but</span> <span m="2877850">it</span> <span m="2877920">actually</span> <span m="2878490">does</span> <span m="2878780">fairly</span> <span m="2879120">well.</span> </p>
<p><span m="2881560">So</span> <span m="2881700">our</span> <span m="2881800">first</span> <span m="2882140">theorem</span> <span m="2883700">is</span> <span m="2883830">going</span> <span m="2883960">to</span> <span m="2884030">be</span> <span m="2884180">that</span> <span m="2884290">TMA</span> <span m="2887030">terminates</span> <span m="2890920">in,</span> <span m="2891420">at</span> <span m="2891650">most,</span> <span m="2893240">N</span> <span m="2893500">squared</span> <span m="2894020">plus</span> <span m="2894300">1</span> <span m="2894610">days.</span> <span m="2898090">N</span> <span m="2898350">is</span> <span m="2898430">the</span> <span m="2898500">number</span> <span m="2898720">of</span> <span m="2898780">boys</span> <span m="2899240">and</span> <span m="2899380">girls.</span> <span m="2900820">The</span> <span m="2900950">proof</span> <span m="2901400">is</span> <span m="2901530">going</span> <span m="2901650">to</span> <span m="2901690">be</span> <span m="2901820">by</span> <span m="2901970">contradiction.</span> <span m="2905370">This</span> <span m="2905510">is</span> <span m="2905620">probably</span> <span m="2905890">the</span> <span m="2906000">only</span> <span m="2906240">day</span> <span m="2906580">where</span> <span m="2906710">we'll</span> <span m="2906820">do</span> <span m="2906950">a</span> <span m="2907000">bunch</span> <span m="2907230">of</span> <span m="2907310">proofs</span> <span m="2907640">and</span> <span m="2907730">none</span> <span m="2907900">of</span> <span m="2907950">them</span> <span m="2908090">use</span> <span m="2908320">induction.</span> <span m="2911380">They're</span> <span m="2911470">pretty</span> <span m="2911670">much</span> <span m="2911880">all</span> <span m="2912100">by</span> <span m="2912210">contradiction.</span> </p>
<p><span m="2914750">Suppose</span> <span m="2915440">TMA</span> <span m="2916010">does</span> <span m="2916150">not</span> <span m="2916480">terminate</span> <span m="2917260">in</span> <span m="2917400">N</span> <span m="2917510">squared</span> <span m="2917860">plus</span> <span m="2918090">1</span> <span m="2918330">days,</span> <span m="2931050">because</span> <span m="2931290">we're</span> <span m="2931400">going</span> <span m="2931530">to</span> <span m="2931860">show</span> <span m="2932060">that</span> <span m="2932270">leads</span> <span m="2932490">to</span> <span m="2932590">a</span> <span m="2932670">contradiction.</span> <span m="2941050">We</span> <span m="2941250">need</span> <span m="2941480">to</span> <span m="2941570">show</span> <span m="2941920">that</span> <span m="2942070">some</span> <span m="2942470">kind</span> <span m="2942750">of</span> <span m="2942840">progress</span> <span m="2943670">is</span> <span m="2943800">made</span> <span m="2944090">each</span> <span m="2944350">day</span> <span m="2945270">to</span> <span m="2945430">show</span> <span m="2945720">that it</span> <span m="2945820">terminates.</span> <span m="2946420">Yeah?</span> </p>
<p><span m="2947206">AUDIENCE:</span> <span m="2947600">[INAUDIBLE]</span> <span m="2948524">the number of</span> <span m="2948986">causes</span> <span m="2949448">that have</span> <span m="2949910">[INAUDIBLE],</span> <span m="2950834">so</span> <span m="2951296">if it has</span> <span m="2951758">not terminated,</span> <span m="2952682">then</span> <span m="2953150">at</span> <span m="2953330">least</span> <span m="2953520">one</span> <span m="2954002">girl is seeing</span> <span m="2954484">a group</span> <span m="2954966">of at least</span> <span m="2955448">one guy--</span> </p>
<p><span m="2955930">PROFESSOR: Yes.</span> </p>
<p><span m="2956412">AUDIENCE: --so</span> <span m="2956894">the number of</span> <span m="2957376">crosses</span> <span m="2957858">cannot</span> <span m="2958340">be defined</span> <span m="2958822">[INAUDIBLE]</span> </p>
<p><span m="2959786">PROFESSOR: Very</span> <span m="2960268">good.</span> <span m="2960750">OK,</span> <span m="2961190">let's</span> <span m="2961440">state</span> <span m="2961630">that</span> <span m="2961790">as</span> <span m="2961900">a</span> <span m="2961980">claim,</span> <span m="2963170">and</span> <span m="2963360">you've</span> <span m="2963460">given</span> <span m="2963730">the</span> <span m="2963830">proof</span> <span m="2964090">of</span> <span m="2964140">the</span> <span m="2964210">claim,</span> <span m="2964580">which</span> <span m="2964750">is</span> <span m="2964860">great.</span> <span m="2966890">If</span> <span m="2967640">we</span> <span m="2967800">don't</span> <span m="2968150">terminate,</span> <span m="2974610">on</span> <span m="2974850">a</span> <span m="2974910">day,</span> <span m="2977970">that</span> <span m="2978160">must</span> <span m="2978480">be</span> <span m="2978810">because</span> <span m="2979540">a</span> <span m="2979660">girl</span> <span m="2980370">had</span> <span m="2980630">two</span> <span m="2980770">boys</span> <span m="2981160">there,</span> <span m="2981520">or</span> <span m="2981580">more,</span> <span m="2982380">therefore</span> <span m="2982770">she</span> <span m="2982960">rejected</span> <span m="2983570">some,</span> <span m="2984120">at</span> <span m="2984200">least</span> <span m="2984440">one.</span> <span m="2985230">And</span> <span m="2985430">that</span> <span m="2985670">night,</span> <span m="2986470">the</span> <span m="2986600">rejected</span> <span m="2987100">boy</span> <span m="2987350">crosses</span> <span m="2987970">a</span> <span m="2988040">girl</span> <span m="2988340">off</span> <span m="2989110">his</span> <span m="2989290">list.</span> </p>
<p><span m="2992440">So if</span> <span m="2992610">we</span> <span m="2992720">don't</span> <span m="2992940">terminate,</span> <span m="2993450">then</span> <span m="2993530">at</span> <span m="2993580">least</span> <span m="2993830">one</span> <span m="2994070">boy</span> <span m="2996160">crosses</span> <span m="2996650">at</span> <span m="2996700">least</span> <span m="2996960">one</span> <span m="2997230">girl</span> <span m="2997860">off</span> <span m="2998060">his</span> <span m="2998230">list.</span> <span m="3006000">And</span> <span m="3006230">so</span> <span m="3006400">we're</span> <span m="3006520">going</span> <span m="3006620">to</span> <span m="3006680">measure</span> <span m="3007050">progress</span> <span m="3009460">by</span> <span m="3009940">the</span> <span m="3010030">cross</span> <span m="3010420">outs.</span> <span m="3015220">So</span> <span m="3015420">every</span> <span m="3015700">day</span> <span m="3015890">we</span> <span m="3015990">don't</span> <span m="3016200">terminate,</span> <span m="3017840">a</span> <span m="3017930">boy</span> <span m="3018150">crossed</span> <span m="3018530">a</span> <span m="3018570">girl</span> <span m="3018790">off his</span> <span m="3019090">list,</span> <span m="3019900">so</span> <span m="3020080">if</span> <span m="3020130">we</span> <span m="3020220">didn't</span> <span m="3020420">terminate at</span> <span m="3020920">N</span> <span m="3021050">squared</span> <span m="3021350">plus</span> <span m="3021580">1</span> <span m="3021810">days,</span> <span m="3022220">we</span> <span m="3022340">must</span> <span m="3022650">have</span> <span m="3022750">crossed</span> <span m="3023220">off</span> <span m="3024180">N</span> <span m="3024460">squared</span> <span m="3024950">plus</span> <span m="3025190">1</span> <span m="3025520">girls</span> <span m="3026830">across</span> <span m="3027270">all</span> <span m="3027540">the</span> <span m="3027590">lists.</span> </p>
<p><span m="3030390">Well,</span> <span m="3031920">is</span> <span m="3032010">that</span> <span m="3032190">possible?</span> <span m="3033390">To</span> <span m="3033790">have</span> <span m="3033880">done</span> <span m="3034090">N</span> <span m="3034230">squared</span> <span m="3034510">plus</span> <span m="3034730">1</span> <span m="3034940">cross</span> <span m="3035290">outs?</span> <span m="3040130">What</span> <span m="3040340">do</span> <span m="3040380">you</span> <span m="3040490">think?</span> <span m="3041600">How</span> <span m="3041790">many</span> <span m="3042030">names</span> <span m="3042490">are</span> <span m="3042600">on</span> <span m="3042760">each</span> <span m="3042970">list?</span> </p>
<p><span m="3043510">AUDIENCE: N.</span> </p>
<p><span m="3044900">PROFESSOR: N,</span> <span m="3045780">and</span> <span m="3046220">how</span> <span m="3046340">many</span> <span m="3046530">lists</span> <span m="3046850">are</span> <span m="3047010">there?</span> </p>
<p><span m="3047766">AUDIENCE: N.</span> </p>
<p><span m="3048620">PROFESSOR: N,</span> <span m="3049100">so</span> <span m="3049200">there's</span> <span m="3049380">N lists</span> <span m="3051880">with</span> <span m="3052310">N</span> <span m="3052490">names</span> <span m="3055410">implies</span> <span m="3056120">there's,</span> <span m="3056300">at</span> <span m="3056390">most,</span> <span m="3056810">N</span> <span m="3057050">squared</span> <span m="3057480">cross</span> <span m="3057880">outs</span> <span m="3058170">ever.</span> <span m="3060870">But</span> <span m="3060990">we</span> <span m="3061120">just</span> <span m="3061300">said</span> <span m="3061500">we</span> <span m="3061610">had</span> <span m="3061850">N</span> <span m="3061980">squared</span> <span m="3062330">plus</span> <span m="3062540">1</span> <span m="3062790">cross</span> <span m="3063160">outs.</span> <span m="3066220">But</span> <span m="3066430">we</span> <span m="3066540">have</span> <span m="3066710">also</span> <span m="3067860">N</span> <span m="3068000">squared</span> <span m="3068350">plus</span> <span m="3068580">1</span> <span m="3068750">cross</span> <span m="3069130">outs,</span> <span m="3071880">and</span> <span m="3072030">that's</span> <span m="3072290">a</span> <span m="3072350">contradiction.</span> <span m="3075930">All</span> <span m="3076090">right?</span> <span m="3077210">So</span> <span m="3077410">we're</span> <span m="3077510">done.</span> <span m="3078720">It</span> <span m="3078810">has</span> <span m="3079100">to</span> <span m="3079210">terminate</span> <span m="3079650">within</span> <span m="3079860">N</span> <span m="3079970">squared</span> <span m="3080220">plus</span> <span m="3080420">1</span> <span m="3080630">days.</span> </p>
<p><span m="3083320">Any</span> <span m="3083530">questions?</span> <span m="3086500">This</span> <span m="3086710">is</span> <span m="3086840">a</span> <span m="3086960">very</span> <span m="3087640">common</span> <span m="3088080">proof</span> <span m="3088400">technique</span> <span m="3088910">in</span> <span m="3089000">computer</span> <span m="3089370">science.</span> <span m="3090630">You're</span> <span m="3090790">analyzing</span> <span m="3091310">some</span> <span m="3091530">system,</span> <span m="3092540">and</span> <span m="3092740">every</span> <span m="3093070">step</span> <span m="3093560">or</span> <span m="3093670">every</span> <span m="3093960">day</span> <span m="3094480">or</span> <span m="3094640">every</span> <span m="3094810">time</span> <span m="3095140">period,</span> <span m="3096100">you</span> <span m="3096240">want</span> <span m="3096410">to</span> <span m="3096460">argue</span> <span m="3096830">progress</span> <span m="3097410">got</span> <span m="3097640">made,</span> <span m="3098840">and</span> <span m="3098950">then</span> <span m="3099070">after</span> <span m="3099270">you've</span> <span m="3099350">made</span> <span m="3099520">enough</span> <span m="3099770">progress</span> <span m="3100260">you</span> <span m="3100350">have</span> <span m="3100680">to</span> <span m="3100770">be</span> <span m="3100880">done,</span> <span m="3101750">and</span> <span m="3101910">therefore,</span> <span m="3103210">the</span> <span m="3103330">algorithm is</span> <span m="3103730">completed.</span> <span m="3106130">All</span> <span m="3106230">right,</span> <span m="3106450">so</span> <span m="3106550">we</span> <span m="3106650">know</span> <span m="3106790">that</span> <span m="3106910">TMA</span> <span m="3107720">terminates.</span> <span m="3109170">Now,</span> <span m="3109310">we've</span> <span m="3109390">still</span> <span m="3109620">got</span> <span m="3109770">to</span> <span m="3109820">get</span> <span m="3109960">everyone</span> <span m="3110320">married</span> <span m="3110800">and</span> <span m="3111010">have</span> <span m="3111240">them</span> <span m="3111310">all</span> <span m="3111980">be</span> <span m="3112350">happy,</span> <span m="3112800">or</span> <span m="3112910">at</span> <span m="3112970">least</span> <span m="3113250">stable.</span> <span m="3116400">Now,</span> <span m="3116700">to</span> <span m="3116830">do</span> <span m="3117040">this,</span> <span m="3117430">we're</span> <span m="3117560">going</span> <span m="3117660">to</span> <span m="3117710">use</span> <span m="3117980">an</span> <span m="3118050">invariant.</span> <span m="3119140">Yeah?</span> </p>
<p><span m="3120583">AUDIENCE: If</span> <span m="3121064">a girl</span> <span m="3121545">has</span> <span m="3122026">some guy</span> <span m="3122988">in front of</span> <span m="3123469">[INAUDIBLE]</span> <span m="3123950">on</span> <span m="3124431">something,</span> <span m="3125393">then she</span> <span m="3125874">will always</span> <span m="3126355">have</span> <span m="3126836">[INAUDIBLE]</span> </p>
<p><span m="3128770">PROFESSOR: That</span> <span m="3129010">is</span> <span m="3129140">true.</span> <span m="3130400">Something</span> <span m="3130750">even</span> <span m="3131050">stronger</span> <span m="3131720">is</span> <span m="3131830">true.</span> </p>
<p><span m="3134060">AUDIENCE: All the</span> <span m="3134535">[INAUDIBLE]</span> </p>
<p><span m="3135490">PROFESSOR: Have</span> <span m="3135730">a--</span> </p>
<p><span m="3137556">PROFESSOR: If she has</span> <span m="3138028">a</span> <span m="3138500">preference</span> <span m="3138972">for someone</span> <span m="3139444">who</span> <span m="3139916">[INAUDIBLE]</span> <span m="3142748">only better</span> <span m="3143220">guys.</span> </p>
<p><span m="3144170">PROFESSOR: Yeah,</span> <span m="3144860">that's a</span> <span m="3145230">great</span> <span m="3145520">invariant.</span> <span m="3146860">As</span> <span m="3147060">the</span> <span m="3147160">girl is</span> <span m="3147480">sitting</span> <span m="3147740">there</span> <span m="3147920">on</span> <span m="3148040">her</span> <span m="3148130">balcony,</span> <span m="3149390">things</span> <span m="3149730">only</span> <span m="3150080">get</span> <span m="3150360">better,</span> <span m="3151920">because</span> <span m="3152170">she</span> <span m="3152300">always</span> <span m="3152730">keeps</span> <span m="3152990">the</span> <span m="3153070">best</span> <span m="3153390">one</span> <span m="3153610">around</span> <span m="3154780">that's</span> <span m="3154960">there.</span> <span m="3155920">And</span> <span m="3156250">when</span> <span m="3156330">new</span> <span m="3156530">ones</span> <span m="3156770">come</span> <span m="3157000">in,</span> <span m="3157470">they've</span> <span m="3157610">got</span> <span m="3157780">to</span> <span m="3157840">be</span> <span m="3157950">better</span> <span m="3158230">than</span> <span m="3158370">the</span> <span m="3158450">last</span> <span m="3158830">one</span> <span m="3160280">for</span> <span m="3160430">her</span> <span m="3160600">to</span> <span m="3160720">keep</span> <span m="3160960">them.</span> <span m="3161110">So</span> <span m="3161660">as</span> <span m="3161850">she</span> <span m="3162030">rejects</span> <span m="3162560">boys,</span> <span m="3163630">she</span> <span m="3163850">only</span> <span m="3164040">does</span> <span m="3164280">that</span> <span m="3164430">because</span> <span m="3164640">she's</span> <span m="3164810">got</span> <span m="3165020">better</span> <span m="3165250">ones</span> <span m="3165480">there,</span> <span m="3165910">and</span> <span m="3166210">whoever</span> <span m="3166490">she</span> <span m="3166620">says</span> <span m="3166800">maybe</span> <span m="3167080">to</span> <span m="3167330">always</span> <span m="3167660">comes</span> <span m="3167880">back.</span> </p>
<p><span m="3168780">So</span> <span m="3169000">an</span> <span m="3169070">invariant</span> <span m="3169900">of</span> <span m="3170020">this</span> <span m="3170210">algorithm</span> <span m="3171420">is</span> <span m="3171700">that</span> <span m="3173390">when</span> <span m="3173560">a</span> <span m="3173620">girl</span> <span m="3174100">has</span> <span m="3174420">a</span> <span m="3174480">suitor,</span> <span m="3175730">going</span> <span m="3176010">forward,</span> <span m="3176400">she</span> <span m="3176540">only</span> <span m="3176760">has</span> <span m="3177790">suitors</span> <span m="3178080">she</span> <span m="3178240">likes</span> <span m="3178520">at</span> <span m="3178590">least</span> <span m="3178820">as</span> <span m="3178920">well.</span> <span m="3179720">And</span> <span m="3179750">if</span> <span m="3179820">she</span> <span m="3179930">ever</span> <span m="3180100">rejects</span> <span m="3180590">a</span> <span m="3180640">boy,</span> <span m="3181750">then</span> <span m="3182150">she's</span> <span m="3182310">got</span> <span m="3182490">somebody</span> <span m="3182780">better</span> <span m="3183070">there</span> <span m="3184160">forever.</span> <span m="3185780">All</span> <span m="3185890">right,</span> <span m="3186060">so</span> <span m="3186150">let's</span> <span m="3186420">state</span> <span m="3186630">that</span> <span m="3186800">as</span> <span m="3186900">an</span> <span m="3186980">invariant</span> <span m="3188410">and</span> <span m="3188640">prove</span> <span m="3188930">that.</span> </p>
<p><span m="3206610">OK,</span> <span m="3207030">so</span> <span m="3208020">we're</span> <span m="3208170">going</span> <span m="3208300">to</span> <span m="3208360">let</span> <span m="3208590">P</span> <span m="3208880">be</span> <span m="3209070">our</span> <span m="3209200">invariant</span> <span m="3209690">here.</span> <span m="3209980">P</span> <span m="3210430">is</span> <span m="3210970">the</span> <span m="3211030">statement</span> <span m="3211510">that</span> <span m="3213500">if</span> <span m="3213710">a</span> <span m="3213780">girl,</span> <span m="3216170">G,</span> <span m="3217370">ever</span> <span m="3219220">rejected</span> <span m="3223140">a boy,</span> <span m="3223690">B,</span> <span m="3227480">then</span> <span m="3227670">the</span> <span m="3227760">girl,</span> <span m="3228360">G,</span> <span m="3232010">has</span> <span m="3232350">a</span> <span m="3232430">suitor,</span> <span m="3233330">or if</span> <span m="3233570">the</span> <span m="3233750">algorithm</span> <span m="3233830">is</span> <span m="3234070">terminated,</span> <span m="3234630">a</span> <span m="3234690">husband</span> <span m="3239190">who</span> <span m="3241270">she</span> <span m="3241520">prefers</span> <span m="3242040">to</span> <span m="3242140">B.</span> <span m="3248410">All</span> <span m="3248550">right,</span> <span m="3248760">that's</span> <span m="3249050">going</span> <span m="3249150">to</span> <span m="3249190">be</span> <span m="3249330">our</span> <span m="3249510">invariant,</span> <span m="3250070">and</span> <span m="3250130">now</span> <span m="3250280">we've</span> <span m="3250380">got</span> <span m="3250510">to</span> <span m="3250570">prove</span> <span m="3250990">it's</span> <span m="3251120">an</span> <span m="3251190">invariant.</span> </p>
<p><span m="3252500">So</span> <span m="3252600">we'll</span> <span m="3252720">do</span> <span m="3252880">that</span> <span m="3253060">with</span> <span m="3253170">a</span> <span m="3253230">lemma</span> <span m="3254350">called</span> <span m="3254620">lemma</span> <span m="3254900">one.</span> <span m="3258230">P</span> <span m="3258770">is</span> <span m="3258860">an</span> <span m="3258950">invariant</span> <span m="3263450">for</span> <span m="3263610">TMA.</span> <span m="3268990">All</span> <span m="3269160">right,</span> <span m="3269270">let's</span> <span m="3269430">prove</span> <span m="3269740">that.</span> <span m="3272410">Now,</span> <span m="3272670">what's</span> <span m="3272900">the</span> <span m="3273010">first</span> <span m="3273280">thing</span> <span m="3273390">you've</span> <span m="3273490">got</span> <span m="3273610">to</span> <span m="3273680">prove</span> <span m="3274130">when</span> <span m="3274250">you're</span> <span m="3274370">proving</span> <span m="3274760">something</span> <span m="3275110">as an</span> <span m="3275220">invariant?</span> <span m="3277680">There's</span> <span m="3277810">two</span> <span m="3278070">things</span> <span m="3278280">you've</span> <span m="3278360">got</span> <span m="3278500">to</span> <span m="3278560">do</span> <span m="3278720">to</span> <span m="3278850">establish</span> <span m="3279380">a</span> <span m="3279420">variant.</span> <span m="3280680">What's</span> <span m="3280970">the</span> <span m="3281070">first</span> <span m="3281250">one?</span> </p>
<p><span m="3281900">AUDIENCE: Base case?</span> </p>
<p><span m="3282375">PROFESSOR: Base</span> <span m="3282850">case.</span> <span m="3283680">Show</span> <span m="3284030">it</span> <span m="3284110">holds</span> <span m="3284410">true</span> <span m="3284650">at</span> <span m="3284730">the</span> <span m="3284800">beginning.</span> <span m="3286310">Proof</span> <span m="3286550">is</span> <span m="3286660">going</span> <span m="3286750">to</span> <span m="3286790">be</span> <span m="3286890">by</span> <span m="3287140">induction,</span> <span m="3289380">and</span> <span m="3289530">so</span> <span m="3289610">we've</span> <span m="3289700">got</span> <span m="3289840">to</span> <span m="3289900">show</span> <span m="3290250">that</span> <span m="3290390">P</span> <span m="3290720">holds</span> <span m="3291060">true</span> <span m="3291280">at</span> <span m="3291360">the</span> <span m="3291430">beginning.</span> <span m="3292380">But</span> <span m="3292590">what</span> <span m="3292760">are</span> <span m="3292800">we</span> <span m="3292920">going</span> <span m="3293040">to</span> <span m="3293190">induct</span> <span m="3293530">on</span> <span m="3293690">here?</span> <span m="3293970">What's</span> <span m="3294220">the</span> <span m="3294340">parameter</span> <span m="3294750">we're</span> <span m="3294890">inducting</span> <span m="3295270">on?</span> </p>
<p><span m="3295950">AUDIENCE: Time?</span> </p>
<p><span m="3296690">PROFESSOR: Time,</span> <span m="3297250">the</span> <span m="3297320">number</span> <span m="3297580">of</span> <span m="3297670">days.</span> <span m="3300810">Good.</span> <span m="3303040">The</span> <span m="3303120">base</span> <span m="3303490">case</span> <span m="3303850">is</span> <span m="3303980">day</span> <span m="3304190">zero,</span> <span m="3307150">the</span> <span m="3307220">beginning.</span> <span m="3313630">All</span> <span m="3313780">right.</span> <span m="3315340">Well,</span> <span m="3315750">is</span> <span m="3315910">that</span> <span m="3317320">statement</span> <span m="3317830">true</span> <span m="3318380">on</span> <span m="3318550">day</span> <span m="3318840">zero?</span> </p>
<p><span m="3322030">Yeah,</span> <span m="3322110">it's</span> <span m="3322405">true</span> <span m="3322700">for</span> <span m="3323000">sort</span> <span m="3323210">of</span> <span m="3323400">a</span> <span m="3323560">weird</span> <span m="3323850">reason.</span> <span m="3324760">Nobody's</span> <span m="3325230">been</span> <span m="3325390">rejected</span> <span m="3325940">yet,</span> <span m="3327040">so</span> <span m="3327525">it's</span> <span m="3327790">what's</span> <span m="3327990">called</span> <span m="3328220">vacuously</span> <span m="3328950">true.</span> <span m="3329900">Because</span> <span m="3331180">no</span> <span m="3331390">girl,</span> <span m="3331630">G,</span> <span m="3331780">has</span> <span m="3331930">rejected</span> <span m="3332330">any</span> <span m="3332550">boy,</span> <span m="3333540">so</span> <span m="3334500">it's</span> <span m="3334700">true.</span> <span m="3338380">So</span> <span m="3338630">no</span> <span m="3338910">one</span> <span m="3339080">is</span> <span m="3339160">rejected</span> <span m="3339660">yet.</span> <span m="3345360">So</span> <span m="3345580">it's</span> <span m="3345750">vacuously</span> <span m="3346320">true.</span> </p>
<p><span m="3352293">All right,</span> <span m="3352760">next</span> <span m="3353000">we</span> <span m="3353080">have</span> <span m="3353290">the</span> <span m="3353390">induction</span> <span m="3353880">step.</span> <span m="3362860">So</span> <span m="3363020">we'll</span> <span m="3363210">assume</span> <span m="3367620">P</span> <span m="3368030">holds</span> <span m="3371960">at</span> <span m="3372280">the</span> <span m="3372490">end</span> <span m="3372840">of</span> <span m="3372950">day</span> <span m="3373200">d,</span> <span m="3376660">and</span> <span m="3376910">we</span> <span m="3377000">need</span> <span m="3377170">to</span> <span m="3377260">argue</span> <span m="3377670">that it</span> <span m="3377880">holds</span> <span m="3378380">now</span> <span m="3379230">at</span> <span m="3379410">the</span> <span m="3379530">end</span> <span m="3379660">of</span> <span m="3380010">day</span> <span m="3380240">d</span> <span m="3380490">plus</span> <span m="3380780">1.</span> <span m="3382850">So</span> <span m="3383120">say</span> <span m="3383460">it's</span> <span m="3383600">true</span> <span m="3384030">up</span> <span m="3384290">to</span> <span m="3384450">now,</span> <span m="3384840">up</span> <span m="3384930">to day</span> <span m="3385260">d.</span> <span m="3385570">Why</span> <span m="3385880">Is</span> <span m="3386000">it</span> <span m="3386080">true</span> <span m="3386300">at</span> <span m="3386370">the</span> <span m="3386460">end</span> <span m="3386560">of</span> <span m="3386610">the</span> <span m="3386690">next</span> <span m="3386980">day?</span> </p>
<p><span m="3388130">Well,</span> <span m="3388260">there's</span> <span m="3388460">two</span> <span m="3388720">cases</span> <span m="3389200">to</span> <span m="3389320">look</span> <span m="3389560">at</span> <span m="3389730">here,</span> <span m="3392810">depending</span> <span m="3393320">on</span> <span m="3393490">when</span> <span m="3394510">G rejected</span> <span m="3395400">B.</span> <span m="3397780">So</span> <span m="3398070">if</span> <span m="3398150">she</span> <span m="3398430">rejects</span> <span m="3398960">B</span> <span m="3405140">on</span> <span m="3405700">this</span> <span m="3405970">day,</span> <span m="3406190">day</span> <span m="3406410">d</span> <span m="3406610">plus</span> <span m="3406880">1,</span> <span m="3410000">well,</span> <span m="3411260">why</span> <span m="3411540">would</span> <span m="3411680">she</span> <span m="3411850">reject</span> <span m="3412340">B on</span> <span m="3412740">day</span> <span m="3413790">d</span> <span m="3414030">plus</span> <span m="3414270">1?</span> <span m="3414820">There's</span> <span m="3415020">only</span> <span m="3415190">one</span> <span m="3415460">scenario.</span> <span m="3415900">Yeah?</span> </p>
<p><span m="3416828">AUDIENCE: There's a</span> <span m="3417292">better boy.</span> </p>
<p><span m="3418220">PROFESSOR: There's</span> <span m="3418450">a</span> <span m="3418520">better</span> <span m="3418810">boy.</span> <span m="3419850">And</span> <span m="3420340">so</span> <span m="3420570">she</span> <span m="3420710">says</span> <span m="3420930">maybe</span> <span m="3421240">to</span> <span m="3421300">him,</span> <span m="3421590">and</span> <span m="3421650">he</span> <span m="3421830">becomes</span> <span m="3422220">her</span> <span m="3422340">suitor.</span> <span m="3423880">So,</span> <span m="3424650">in</span> <span m="3424770">fact,</span> <span m="3425060">P</span> <span m="3425230">is</span> <span m="3425350">true.</span> <span m="3428010">So</span> <span m="3430560">then</span> <span m="3430770">there</span> <span m="3430890">was</span> <span m="3431150">someone</span> <span m="3431440">better,</span> <span m="3440670">and</span> <span m="3440840">that</span> <span m="3441000">implies</span> <span m="3442070">P</span> <span m="3442320">is</span> <span m="3442460">true</span> <span m="3444630">on</span> <span m="3445170">day</span> <span m="3445360">d</span> <span m="3445570">plus</span> <span m="3445850">1.</span> </p>
<p><span m="3447950">Case</span> <span m="3448280">two</span> <span m="3448700">is</span> <span m="3449100">very</span> <span m="3449470">similar.</span> <span m="3449910">It's</span> <span m="3450040">a</span> <span m="3450090">very</span> <span m="3450270">simple</span> <span m="3450630">proof.</span> <span m="3453160">G</span> <span m="3453450">rejected</span> <span m="3454650">B</span> <span m="3456630">before</span> <span m="3457090">day</span> <span m="3457290">d,</span> <span m="3460290">before</span> <span m="3460580">d</span> <span m="3460740">plus</span> <span m="3460960">1.</span> <span m="3465030">Well,</span> <span m="3465220">now</span> <span m="3465510">we</span> <span m="3465650">use</span> <span m="3466790">the</span> <span m="3466890">fact</span> <span m="3467180">that</span> <span m="3467880">P</span> <span m="3468140">was</span> <span m="3468290">true</span> <span m="3469300">at</span> <span m="3469460">the</span> <span m="3469590">end</span> <span m="3469760">of</span> <span m="3469870">day</span> <span m="3470130">d,</span> <span m="3470700">which</span> <span m="3470940">means</span> <span m="3472410">P</span> <span m="3472650">now</span> <span m="3472850">implies</span> <span m="3473540">that</span> <span m="3474600">G</span> <span m="3475090">had</span> <span m="3476930">at</span> <span m="3477160">least</span> <span m="3477540">as</span> <span m="3477650">good</span> <span m="3477800">a</span> <span m="3477860">suitor.</span> <span m="3481990">Actually,</span> <span m="3482220">it's</span> <span m="3482330">better,</span> <span m="3482730">because</span> <span m="3482880">it</span> <span m="3482930">was</span> <span m="3483050">rejected.</span> <span m="3486900">A</span> <span m="3486980">better</span> <span m="3487380">suitor</span> <span m="3491750">on</span> <span m="3492190">day</span> <span m="3492460">d,</span> <span m="3496140">that's</span> <span m="3496360">what</span> <span m="3497030">the</span> <span m="3497130">hypothesis</span> <span m="3497870">says,</span> <span m="3498340">the</span> <span m="3498690">invariant</span> <span m="3499130">says.</span> <span m="3499810">And</span> <span m="3500000">now</span> <span m="3500210">we</span> <span m="3500300">just</span> <span m="3500460">have</span> <span m="3500550">to</span> <span m="3500630">look</span> <span m="3500810">at</span> <span m="3500880">what</span> <span m="3501030">happens</span> <span m="3501430">on</span> <span m="3501690">d plus</span> <span m="3502140">1.</span> </p>
<p><span m="3505360">Well,</span> <span m="3506540">either</span> <span m="3506810">she</span> <span m="3506950">has</span> <span m="3507180">the</span> <span m="3507270">same</span> <span m="3507620">suitor on</span> <span m="3507930">d</span> <span m="3508050">plus</span> <span m="3508470">1,</span> <span m="3508780">or</span> <span m="3508870">somebody</span> <span m="3509190">better</span> <span m="3509440">came</span> <span m="3509670">along.</span> <span m="3512030">And</span> <span m="3512170">so</span> <span m="3512330">we're going</span> <span m="3512450">to</span> <span m="3512550">be done.</span> <span m="3525150">She</span> <span m="3525280">has</span> <span m="3525430">the</span> <span m="3525530">same</span> <span m="3527380">or</span> <span m="3527640">better</span> <span m="3530450">suitor</span> <span m="3532940">on</span> <span m="3533280">day</span> <span m="3533500">d</span> <span m="3533730">plus</span> <span m="3534040">1,</span> <span m="3535850">and</span> <span m="3536020">that</span> <span m="3536200">implies</span> <span m="3536710">P</span> <span m="3536920">is</span> <span m="3537040">true</span> <span m="3537410">on</span> <span m="3537520">d</span> <span m="3537660">plus</span> <span m="3537920">1,</span> <span m="3542600">and</span> <span m="3542990">we're</span> <span m="3543100">done.</span> </p>
<p><span m="3546250">All</span> <span m="3546350">right,</span> <span m="3546520">so</span> <span m="3546600">I</span> <span m="3546660">went</span> <span m="3546970">through</span> <span m="3547140">this</span> <span m="3547350">proof.</span> <span m="3547620">It</span> <span m="3547710">was</span> <span m="3547820">sort</span> <span m="3548110">of</span> <span m="3548230">obvious,</span> <span m="3548680">but</span> <span m="3548800">this</span> <span m="3548970">is</span> <span m="3549620">the</span> <span m="3549720">careful</span> <span m="3550080">way</span> <span m="3550240">you'd</span> <span m="3550390">write</span> <span m="3550570">it</span> <span m="3550680">down</span> <span m="3551630">to</span> <span m="3551790">show that</span> <span m="3552030">the</span> <span m="3552210">invariant</span> <span m="3552640">holds.</span> <span m="3554630">Any</span> <span m="3554780">questions</span> <span m="3555220">about</span> <span m="3556210">the</span> <span m="3556310">invariant</span> <span m="3557720">dilemma?</span> </p>
<p><span m="3560930">All</span> <span m="3561090">right,</span> <span m="3561310">so</span> <span m="3561400">things</span> <span m="3561680">only</span> <span m="3562030">get</span> <span m="3562200">better</span> <span m="3562530">for</span> <span m="3562630">the</span> <span m="3562730">girls.</span> <span m="3563070">If</span> <span m="3563120">she</span> <span m="3563350">ever</span> <span m="3563620">rejected</span> <span m="3564100">somebody,</span> <span m="3564510">she's</span> <span m="3564600">got</span> <span m="3564810">somebody</span> <span m="3565100">better.</span> <span m="3566260">So</span> <span m="3566400">now</span> <span m="3566650">we</span> <span m="3566750">can</span> <span m="3566870">prove</span> <span m="3568520">the main</span> <span m="3568820">result,</span> <span m="3571230">that</span> <span m="3571450">everyone</span> <span m="3571900">is</span> <span m="3572000">married.</span> <span m="3582660">And</span> <span m="3582770">again</span> <span m="3583100">the</span> <span m="3583210">proof</span> <span m="3583470">will</span> <span m="3583550">be</span> <span m="3583670">by</span> <span m="3583840">contradiction.</span> <span m="3592720">So</span> <span m="3592940">we</span> <span m="3593130">assume</span> <span m="3594150">not</span> <span m="3594420">everyone</span> <span m="3594810">was</span> <span m="3594960">married.</span> </p>
<p><span m="3600430">Assume,</span> <span m="3600830">for</span> <span m="3600900">the</span> <span m="3601010">purpose</span> <span m="3601340">of</span> <span m="3601410">contradiction,</span> <span m="3602070">that</span> <span m="3602280">some</span> <span m="3602550">boy,</span> <span m="3607710">B,</span> <span m="3608020">we'll</span> <span m="3608150">call him,</span> <span m="3609960">is</span> <span m="3610290">not</span> <span m="3610690">married.</span> <span m="3611650">Because</span> <span m="3611840">if</span> <span m="3611990">everyone</span> <span m="3612350">is</span> <span m="3612420">not</span> <span m="3612630">married</span> <span m="3612950">then</span> <span m="3613060">some</span> <span m="3613230">boy is</span> <span m="3613670">not.</span> <span m="3614280">If</span> <span m="3614440">not</span> <span m="3614690">everyone</span> <span m="3615000">is</span> <span m="3615090">married</span> <span m="3615410">then</span> <span m="3615520">some</span> <span m="3615750">boy</span> <span m="3616100">is</span> <span m="3616310">not</span> <span m="3616530">married.</span> <span m="3619530">So</span> <span m="3619750">when it</span> <span m="3619950">terminates,</span> <span m="3620630">B</span> <span m="3621140">is</span> <span m="3621300">not</span> <span m="3621580">married.</span> <span m="3624790">Well,</span> <span m="3625070">what</span> <span m="3625240">do</span> <span m="3625280">you</span> <span m="3625400">know</span> <span m="3625650">about</span> <span m="3626010">B</span> <span m="3627080">if</span> <span m="3627200">he</span> <span m="3627300">was</span> <span m="3627460">not</span> <span m="3627720">married</span> <span m="3628070">at</span> <span m="3628210">the</span> <span m="3628370">end?</span> </p>
<p><span m="3633680">PROFESSOR: He was</span> <span m="3634177">rejected by</span> <span m="3634674">everyone.</span> </p>
<p><span m="3635670">PROFESSOR: He</span> <span m="3636050">was</span> <span m="3636200">rejected</span> <span m="3636820">by</span> <span m="3637000">everyone,</span> <span m="3637980">because</span> <span m="3638370">if</span> <span m="3638480">at</span> <span m="3638560">the</span> <span m="3638750">end,</span> <span m="3639110">he's</span> <span m="3639270">still</span> <span m="3639580">under</span> <span m="3639840">a</span> <span m="3639880">balcony,</span> <span m="3640800">if</span> <span m="3640910">he</span> <span m="3641020">still</span> <span m="3641290">had</span> <span m="3641560">somebody</span> <span m="3641930">on his</span> <span m="3642200">list,</span> <span m="3643180">he'd</span> <span m="3643330">be</span> <span m="3643530">there.</span> <span m="3644640">And</span> <span m="3644800">he'd</span> <span m="3645090">be</span> <span m="3645190">getting</span> <span m="3645430">married,</span> <span m="3645800">because</span> <span m="3645970">it's</span> <span m="3646110">the</span> <span m="3646250">end.</span> <span m="3648840">So</span> <span m="3649580">this</span> <span m="3649810">means</span> <span m="3650290">that</span> <span m="3650390">if</span> <span m="3650520">B is</span> <span m="3650760">not</span> <span m="3650970">married,</span> <span m="3651380">he's rejected</span> <span m="3651860">by</span> <span m="3651980">everybody.</span> <span m="3652360">Yeah?</span> </p>
<p><span m="3652720">AUDIENCE:</span> <span m="3653080">[INAUDIBLE]</span> <span m="3654574">list?</span> </p>
<p><span m="3655570">PROFESSOR: Oh,</span> <span m="3655730">he's</span> <span m="3656020">on</span> <span m="3656340">everybody's</span> <span m="3656860">list.</span> </p>
<p><span m="3657170">AUDIENCE: Yeah.</span> </p>
<p><span m="3659710">PROFESSOR: Everybody</span> <span m="3660250">has</span> <span m="3660550">everybody</span> <span m="3660950">of the</span> <span m="3661060">opposite</span> <span m="3661420">sex</span> <span m="3661700">on</span> <span m="3661770">their</span> <span m="3661900">list,</span> <span m="3663240">but</span> <span m="3663390">he</span> <span m="3664040">had</span> <span m="3664290">to cross</span> <span m="3664600">everybody</span> <span m="3664910">off.</span> <span m="3665860">That's</span> <span m="3666090">true.</span> <span m="3667150">Yeah?</span> </p>
<p><span m="3667230">AUDIENCE: That would</span> <span m="3667703">mean that</span> <span m="3668176">everyone had</span> <span m="3668649">somebody</span> <span m="3669122">better</span> <span m="3669595">on the same</span> <span m="3670068">day that</span> <span m="3670541">[INAUDIBLE]</span> <span m="3671014">telling him she</span> <span m="3671487">didn't</span> <span m="3671960">want to be</span> <span m="3672433">with him.</span> </p>
<p><span m="3673380">PROFESSOR: That's</span> <span m="3673650">true.</span> <span m="3674010">That</span> <span m="3674150">means</span> <span m="3675070">that</span> <span m="3675780">B</span> <span m="3676040">crossed</span> <span m="3676450">every</span> <span m="3676650">girl</span> <span m="3676940">off.</span> <span m="3677390">B is</span> <span m="3677650">rejected</span> <span m="3678200">by</span> <span m="3678360">every</span> <span m="3678570">girl,</span> <span m="3679460">which</span> <span m="3679640">means</span> <span m="3679900">every</span> <span m="3680190">girl</span> <span m="3680450">has</span> <span m="3680630">somebody</span> <span m="3680980">better</span> <span m="3681270">than</span> <span m="3681430">B,</span> <span m="3683150">which</span> <span m="3683360">is</span> <span m="3683470">not</span> <span m="3683670">possible,</span> <span m="3684310">because</span> <span m="3684680">that</span> <span m="3684880">would</span> <span m="3685020">mean</span> <span m="3687330">every</span> <span m="3687670">girl</span> <span m="3687900">was</span> <span m="3688030">married.</span> <span m="3689290">And</span> <span m="3689450">therefore,</span> <span m="3689760">the</span> <span m="3690070">equal</span> <span m="3690290">number of</span> <span m="3690480">boys</span> <span m="3690760">and</span> <span m="3690870">girls,</span> <span m="3691260">that</span> <span m="3691450">means</span> <span m="3691650">B</span> <span m="3691830">would</span> <span m="3691930">have</span> <span m="3691990">been</span> <span m="3692130">married.</span> <span m="3693430">Good.</span> <span m="3693690">All right,</span> <span m="3693830">let's</span> <span m="3694020">write</span> <span m="3694240">that</span> <span m="3694470">down.</span> </p>
<p><span m="3697090">This</span> <span m="3697230">means</span> <span m="3697560">that</span> <span m="3697730">B</span> <span m="3697930">was</span> <span m="3698100">rejected</span> <span m="3698640">by</span> <span m="3698780">every</span> <span m="3699010">girl.</span> <span m="3707980">OK,</span> <span m="3708510">that</span> <span m="3708750">means</span> <span m="3709030">that</span> <span m="3709200">every</span> <span m="3709520">girl,</span> <span m="3710730">by</span> <span m="3710860">lemma</span> <span m="3711110">1,</span> <span m="3713320">has</span> <span m="3713530">a</span> <span m="3713590">better</span> <span m="3714130">suitor,</span> <span m="3720690">and that's</span> <span m="3721010">where</span> <span m="3721120">we</span> <span m="3721240">use</span> <span m="3721480">lemma</span> <span m="3721740">1.</span> <span m="3727400">And</span> <span m="3727510">that</span> <span m="3727700">means</span> <span m="3728030">that</span> <span m="3728150">every</span> <span m="3728400">girl</span> <span m="3728680">is</span> <span m="3728770">married,</span> <span m="3736640">and</span> <span m="3736760">that</span> <span m="3736950">means</span> <span m="3737590">that</span> <span m="3737690">every</span> <span m="3737890">boy</span> <span m="3738190">is</span> <span m="3738350">married,</span> <span m="3739510">including</span> <span m="3739960">B,</span> <span m="3743570">and</span> <span m="3743850">that's</span> <span m="3744110">a</span> <span m="3744170">contradiction,</span> <span m="3744910">because</span> <span m="3744980">we</span> <span m="3745080">said</span> <span m="3745360">B</span> <span m="3745540">wasn't</span> <span m="3745900">married.</span> <span m="3749016">OK?</span> <span m="3752290">Everybody</span> <span m="3752530">buy</span> <span m="3752780">that</span> <span m="3754360">proof?</span> <span m="3754770">Any questions</span> <span m="3755227">about that?</span> </p>
<p><span m="3758890">Yeah,</span> <span m="3759070">proof</span> <span m="3759270">by</span> <span m="3759390">contradiction</span> <span m="3760040">is a</span> <span m="3760150">pretty</span> <span m="3760350">powerful</span> <span m="3760780">technique.</span> <span m="3762110">Once</span> <span m="3762260">you</span> <span m="3762370">assume</span> <span m="3762680">something</span> <span m="3762910">is</span> <span m="3763060">not</span> <span m="3763250">going</span> <span m="3763340">to</span> <span m="3763380">be</span> <span m="3763470">true,</span> <span m="3763800">it</span> <span m="3765110">gives</span> <span m="3765250">you</span> <span m="3765340">a</span> <span m="3765360">lot</span> <span m="3765500">of</span> <span m="3765560">power</span> <span m="3765890">to</span> <span m="3765960">find</span> <span m="3766920">a</span> <span m="3767260">contradiction.</span> <span m="3770820">All</span> <span m="3770990">right,</span> <span m="3771190">so</span> <span m="3771270">now</span> <span m="3771570">we</span> <span m="3771690">know</span> <span m="3771970">that</span> <span m="3772490">the</span> <span m="3772640">algorithm</span> <span m="3773010">ends,</span> <span m="3773380">and</span> <span m="3773460">everybody</span> <span m="3773740">gets</span> <span m="3773940">married.</span> <span m="3774430">All's we</span> <span m="3774790">got</span> <span m="3774940">to</span> <span m="3775020">do</span> <span m="3775350">is</span> <span m="3775420">show</span> <span m="3775810">that</span> <span m="3776930">there's</span> <span m="3777130">no</span> <span m="3777500">rogue</span> <span m="3777880">couples,</span> <span m="3780180">so</span> <span m="3780350">let's</span> <span m="3780600">do</span> <span m="3780750">that.</span> </p>
<p><span m="3788830">TMA</span> <span m="3790470">produces</span> <span m="3793730">a</span> <span m="3793880">stable</span> <span m="3794520">matching.</span> <span m="3802210">Now,</span> <span m="3802310">how</span> <span m="3802480">do</span> <span m="3802540">you</span> <span m="3802630">suppose</span> <span m="3802960">we're</span> <span m="3803060">going</span> <span m="3803170">to</span> <span m="3803760">prove</span> <span m="3804050">this?</span> <span m="3805180">What's</span> <span m="3805400">going</span> <span m="3805510">to</span> <span m="3805550">be</span> <span m="3805680">the</span> <span m="3805810">approach</span> <span m="3806190">to</span> <span m="3806290">prove</span> <span m="3806540">this?</span> <span m="3807396">Yeah?</span> </p>
<p><span m="3807882">AUDIENCE: Assume that</span> <span m="3808368">there's a rogue</span> <span m="3808854">couple.</span> </p>
<p><span m="3809340">PROFESSOR: Assume</span> <span m="3809820">that</span> <span m="3809920">there's</span> <span m="3810080">a</span> <span m="3810170">rogue</span> <span m="3810450">couple,</span> <span m="3810840">that</span> <span m="3810990">namely</span> <span m="3811300">this</span> <span m="3811480">is</span> <span m="3811620">not</span> <span m="3811850">true,</span> <span m="3812240">so</span> <span m="3812290">there</span> <span m="3812360">must</span> <span m="3812580">be</span> <span m="3812710">rogue</span> <span m="3813030">couple.</span> <span m="3815280">So</span> <span m="3815490">let</span> <span m="3817920">Bob</span> <span m="3818900">and</span> <span m="3819130">Gail</span> <span m="3822020">be</span> <span m="3822710">any</span> <span m="3825560">pair</span> <span m="3829290">that</span> <span m="3830010">are</span> <span m="3830150">not</span> <span m="3830390">married.</span> <span m="3838480">I</span> <span m="3838590">need</span> <span m="3838780">to</span> <span m="3838860">prove</span> <span m="3839460">the</span> <span m="3839760">Bob and</span> <span m="3840190">Gail</span> <span m="3840430">are</span> <span m="3840510">not</span> <span m="3840780">rogue,</span> <span m="3841840">and</span> <span m="3841910">then</span> <span m="3842030">we'll</span> <span m="3842130">be</span> <span m="3842250">fine.</span> <span m="3842510">Because if</span> <span m="3842640">it</span> <span m="3842750">says</span> <span m="3842940">everybody</span> <span m="3843280">who is</span> <span m="3843390">not</span> <span m="3843660">married</span> <span m="3844550">is</span> <span m="3844680">not</span> <span m="3844870">rogue,</span> <span m="3845260">then</span> <span m="3845430">we</span> <span m="3845510">know</span> <span m="3845660">we</span> <span m="3845750">have</span> <span m="3845930">a</span> <span m="3845990">stable</span> <span m="3847170">matching.</span> </p>
<p><span m="3849490">Now,</span> <span m="3849700">there's</span> <span m="3849860">a</span> <span m="3849920">couple</span> <span m="3850240">of</span> <span m="3850280">cases</span> <span m="3850720">here.</span> <span m="3850860">Bob and</span> <span m="3851260">Gail</span> <span m="3851560">weren't</span> <span m="3851810">married,</span> <span m="3853510">so</span> <span m="3853660">there's</span> <span m="3853990">two</span> <span m="3854220">ways</span> <span m="3854560">that</span> <span m="3854760">could</span> <span m="3854860">have</span> <span m="3854950">happened.</span> <span m="3857960">What's</span> <span m="3858190">one</span> <span m="3858440">of</span> <span m="3858520">them?</span> <span m="3861440">What's</span> <span m="3861660">one</span> <span m="3861900">reason</span> <span m="3862230">they</span> <span m="3862310">might</span> <span m="3862560">not be</span> <span m="3862850">married,</span> <span m="3863210">something</span> <span m="3863420">that</span> <span m="3863540">happened</span> <span m="3863960">that</span> <span m="3864593">made</span> <span m="3865086">that impossible?</span> <span m="3865580">Yeah?</span> </p>
<p><span m="3867010">AUDIENCE: Gail</span> <span m="3867500">rejected</span> <span m="3867990">Bob.</span> </p>
<p><span m="3868480">PROFESSOR: Good.</span> <span m="3868800">Case</span> <span m="3869130">one--</span> <span m="3869420">Gail</span> <span m="3869680">rejected</span> <span m="3870200">Bob.</span> <span m="3881330">Well,</span> <span m="3881540">what</span> <span m="3881720">do</span> <span m="3881790">we</span> <span m="3881930">know</span> <span m="3882290">in</span> <span m="3882390">that</span> <span m="3882620">case,</span> <span m="3883210">if</span> <span m="3883520">Gail</span> <span m="3883810">rejected</span> <span m="3884270">Bob?</span> </p>
<p><span m="3885756">AUDIENCE: Gail had</span> <span m="3886194">better suitors.</span> </p>
<p><span m="3887070">PROFESSOR: Gail has</span> <span m="3887510">another</span> <span m="3888020">suitor</span> <span m="3888350">that</span> <span m="3888580">she</span> <span m="3888710">likes</span> <span m="3889220">better.</span> <span m="3891430">And,</span> <span m="3891550">in</span> <span m="3891640">fact,</span> <span m="3894160">what</span> <span m="3894300">do</span> <span m="3894360">we</span> <span m="3894460">know</span> <span m="3894600">about</span> <span m="3894810">who</span> <span m="3894980">Gail</span> <span m="3895230">married?</span> </p>
<p><span m="3896674">AUDIENCE: Better than</span> <span m="3897096">Bob.</span> </p>
<p><span m="3897896">PROFESSOR: Better than</span> <span m="3898272">Bob--</span> <span m="3898650">things</span> <span m="3899060">only</span> <span m="3899500">get</span> <span m="3899710">better for the</span> <span m="3900130">girls.</span> <span m="3901780">That's</span> <span m="3902030">the</span> <span m="3902120">lemma</span> <span m="3902450">one.</span> <span m="3903630">All</span> <span m="3903770">right,</span> <span m="3904130">so</span> <span m="3905040">this</span> <span m="3905330">means</span> <span m="3905760">that</span> <span m="3906630">Gail</span> <span m="3907020">marries</span> <span m="3911660">someone</span> <span m="3914850">that</span> <span m="3914990">she</span> <span m="3915260">thinks</span> <span m="3915530">is</span> <span m="3915650">better</span> <span m="3915930">than</span> <span m="3916090">Bob.</span> <span m="3920240">And</span> <span m="3920370">that's</span> <span m="3920620">by</span> <span m="3920770">lemma</span> <span m="3921100">one.</span> </p>
<p><span m="3926460">Well,</span> <span m="3927320">can</span> <span m="3927530">Gail and</span> <span m="3927930">Bob be</span> <span m="3928400">a</span> <span m="3928490">rogue</span> <span m="3928780">couple</span> <span m="3929100">here?</span> <span m="3931310">No,</span> <span m="3931570">because</span> <span m="3931810">Gail</span> <span m="3932260">likes</span> <span m="3932660">her</span> <span m="3932820">spouse</span> <span m="3933490">better</span> <span m="3933810">than</span> <span m="3934000">Bob,</span> <span m="3934970">so</span> <span m="3935310">she's</span> <span m="3935660">not</span> <span m="3935930">going</span> <span m="3936050">to</span> <span m="3936110">be</span> <span m="3936230">in</span> <span m="3936320">a</span> <span m="3936410">rogue</span> <span m="3936690">affair</span> <span m="3937180">with</span> <span m="3937310">Bob.</span> <span m="3940410">So</span> <span m="3942750">that</span> <span m="3943040">means</span> <span m="3943440">that</span> <span m="3945000">Gail</span> <span m="3946190">and</span> <span m="3946340">Bob</span> <span m="3948450">are</span> <span m="3948950">not</span> <span m="3949490">rogue.</span> </p>
<p><span m="3957380">All</span> <span m="3957530">right,</span> <span m="3957790">case</span> <span m="3958170">two</span> <span m="3960230">is</span> <span m="3960560">Gail</span> <span m="3961740">did</span> <span m="3961890">not</span> <span m="3962170">reject</span> <span m="3962600">Bob.</span> <span m="3964890">She</span> <span m="3965050">never</span> <span m="3965320">did.</span> <span m="3969792">That's</span> <span m="3970260">the</span> <span m="3970460">other</span> <span m="3970640">case,</span> <span m="3971030">she</span> <span m="3971120">didn't</span> <span m="3971400">reject</span> <span m="3971770">Bob.</span> <span m="3973500">Could</span> <span m="3974060">Bob</span> <span m="3974440">have</span> <span m="3974610">ever</span> <span m="3975000">serenaded</span> <span m="3975760">Gail</span> <span m="3976320">in</span> <span m="3976420">this</span> <span m="3976590">case?</span> </p>
<p><span m="3978100">No,</span> <span m="3978500">because</span> <span m="3978780">if</span> <span m="3978870">he</span> <span m="3978970">did</span> <span m="3979480">and he</span> <span m="3979670">was</span> <span m="3979810">never</span> <span m="3980050">rejected,</span> <span m="3981220">they</span> <span m="3981340">would</span> <span m="3981460">have</span> <span m="3981570">ended</span> <span m="3981800">up</span> <span m="3981900">married.</span> <span m="3983870">All</span> <span m="3983960">right?</span> <span m="3984790">So</span> <span m="3987720">that</span> <span m="3987940">means</span> <span m="3988300">the</span> <span m="3988390">Bob</span> <span m="3991800">never</span> <span m="3993380">serenaded</span> <span m="3994240">Gail.</span> <span m="4001390">What</span> <span m="4001580">does</span> <span m="4001730">that</span> <span m="4001990">mean</span> <span m="4002270">about</span> <span m="4002790">how</span> <span m="4002980">Bob</span> <span m="4003480">feels</span> <span m="4003940">about</span> <span m="4004560">Gail?</span> <span m="4005050">Yeah?</span> </p>
<p><span m="4005502">AUDIENCE: Bob</span> <span m="4005954">must have</span> <span m="4006406">never</span> <span m="4006858">serenaded</span> <span m="4007310">for</span> <span m="4007762">Gail.</span> </p>
<p><span m="4008670">PROFESSOR: Yeah,</span> <span m="4009670">Bob</span> <span m="4010070">never</span> <span m="4010360">got</span> <span m="4010850">far</span> <span m="4011080">enough</span> <span m="4011300">down</span> <span m="4011600">on</span> <span m="4011740">his</span> <span m="4011890">list</span> <span m="4012770">to</span> <span m="4013110">serenade</span> <span m="4013630">Gail.</span> <span m="4014780">He</span> <span m="4014930">got</span> <span m="4015170">married</span> <span m="4016520">before</span> <span m="4016970">he</span> <span m="4017070">got</span> <span m="4017290">down</span> <span m="4017570">there.</span> <span m="4019830">All</span> <span m="4019940">right,</span> <span m="4020200">so</span> <span m="4020290">that</span> <span m="4020530">means</span> <span m="4021370">that</span> <span m="4022210">Gail</span> <span m="4024190">is</span> <span m="4024580">lower</span> <span m="4026850">on</span> <span m="4027140">Bob's</span> <span m="4027510">list</span> <span m="4030920">than</span> <span m="4031120">Bob's</span> <span m="4031480">wife.</span> <span m="4036990">And</span> <span m="4037170">that</span> <span m="4037420">means</span> <span m="4038970">that</span> <span m="4039140">they're</span> <span m="4039340">not</span> <span m="4039570">rogue,</span> <span m="4040940">because</span> <span m="4041200">Bob</span> <span m="4041490">likes</span> <span m="4041750">his</span> <span m="4041850">wife</span> <span m="4042150">better</span> <span m="4042350">than</span> <span m="4042500">Gail.</span> </p>
<p><span m="4053380">All</span> <span m="4053550">right,</span> <span m="4053770">so</span> <span m="4053990">in</span> <span m="4054080">each</span> <span m="4054430">case,</span> <span m="4054700">the</span> <span m="4054800">cases</span> <span m="4055260">clearly</span> <span m="4055620">cover</span> <span m="4055940">everything.</span> <span m="4056420">Gail</span> <span m="4056660">rejected</span> <span m="4057100">Bob,</span> <span m="4057260">or</span> <span m="4057420">she</span> <span m="4057550">didn't.</span> <span m="4058570">Either</span> <span m="4058880">way,</span> <span m="4059350">Gail</span> <span m="4059580">and</span> <span m="4059670">Bob</span> <span m="4059910">are</span> <span m="4059990">not</span> <span m="4060320">rogue.</span> <span m="4062030">So</span> <span m="4062180">that</span> <span m="4062440">means</span> <span m="4062870">there's</span> <span m="4063070">no</span> <span m="4063430">rogue</span> <span m="4063750">couples,</span> <span m="4069800">and</span> <span m="4070150">that</span> <span m="4070390">implies</span> <span m="4071660">M</span> <span m="4071970">is</span> <span m="4072060">stable,</span> <span m="4072480">TMA</span> <span m="4072850">is</span> <span m="4072930">stable.</span> <span m="4076336">OK?</span> </p>
<p><span m="4079230">All</span> <span m="4079390">right,</span> <span m="4079630">so</span> <span m="4080360">TMA</span> <span m="4080720">terminates,</span> <span m="4081440">everyone</span> <span m="4081700">gets</span> <span m="4081880">married,</span> <span m="4082790">no</span> <span m="4083020">rogue</span> <span m="4083280">couples,</span> <span m="4086120">nice</span> <span m="4086390">outlook.</span> <span m="4086650">So</span> <span m="4086770">we're</span> <span m="4086840">done.</span> <span m="4087120">We</span> <span m="4087220">actually</span> <span m="4087460">proved</span> <span m="4087690">it</span> <span m="4087790">works.</span> <span m="4089370">One</span> <span m="4089720">issue</span> <span m="4090140">left</span> <span m="4090620">to</span> <span m="4090710">think</span> <span m="4090950">about</span> <span m="4091250">here.</span> <span m="4091990">Any</span> <span m="4092280">questions</span> <span m="4092640">on that</span> <span m="4092830">before</span> <span m="4093090">we</span> <span m="4094040">launch</span> <span m="4094410">off</span> <span m="4094600">into</span> <span m="4094750">the</span> <span m="4094820">last</span> <span m="4095170">issue?</span> </p>
<p><span m="4096048">AUDIENCE: Is</span> <span m="4096536">it unique?</span> </p>
<p><span m="4099960">PROFESSOR: Is</span> <span m="4100170">it</span> <span m="4100540">unique?</span> <span m="4101649">TMA</span> <span m="4103310">gives</span> <span m="4103510">you</span> <span m="4103680">a</span> <span m="4103750">unique</span> <span m="4104120">answer</span> <span m="4105740">because</span> <span m="4106279">it's</span> <span m="4106590">an</span> <span m="4106750">algorithm.</span> <span m="4107430">It's</span> <span m="4107880">deterministic.</span> <span m="4109310">But</span> <span m="4109470">there</span> <span m="4109580">may</span> <span m="4109990">be</span> <span m="4110170">other</span> <span m="4110540">stable</span> <span m="4111479">matchings.</span> <span m="4113649">OK,</span> <span m="4114069">so</span> <span m="4114340">there's</span> <span m="4114560">not</span> <span m="4114800">just</span> <span m="4115060">one</span> <span m="4115390">stable</span> <span m="4115710">matching,</span> <span m="4116090">necessarily.</span> <span m="4116729">You</span> <span m="4116810">could</span> <span m="4116920">make</span> <span m="4117130">examples</span> <span m="4117660">with</span> <span m="4117779">multiple</span> <span m="4118310">stable</span> <span m="4118630">matchings.</span> </p>
<p><span m="4120170">That's</span> <span m="4120359">a</span> <span m="4120399">great</span> <span m="4120609">question.</span> <span m="4122524">Any other</span> <span m="4123009">questions?</span> <span m="4126410">All</span> <span m="4126640">right.</span> <span m="4127160">Oh, yeah?</span> </p>
<p><span m="4127656">AUDIENCE: Is there</span> <span m="4128648">generally</span> <span m="4129144">any other</span> <span m="4129640">way to</span> <span m="4130136">assess optimality</span> <span m="4131128">besides the</span> <span m="4131624">fact that it's</span> <span m="4132120">stable,</span> <span m="4132616">or--</span> </p>
<p><span m="4133608">PROFESSOR: Yeah,</span> <span m="4134600">you can make</span> <span m="4135109">up</span> <span m="4135140">lots of</span> <span m="4135620">them.</span> <span m="4136640">You</span> <span m="4136779">could</span> <span m="4136899">put</span> <span m="4137060">weights</span> <span m="4137380">on</span> <span m="4137500">the</span> <span m="4137670">edges</span> <span m="4138010">and</span> <span m="4138120">get</span> <span m="4138250">a</span> <span m="4138290">min-weight</span> <span m="4138740">matching.</span> <span m="4139750">You</span> <span m="4139960">could</span> <span m="4142170">try</span> <span m="4142370">to</span> <span m="4142439">get</span> <span m="4142920">the</span> <span m="4143830">perfect</span> <span m="4144300">matching</span> <span m="4144800">with</span> <span m="4144939">the</span> <span m="4145040">least</span> <span m="4145580">unfavorable</span> <span m="4146250">marriage</span> <span m="4146970">kind</span> <span m="4147149">of</span> <span m="4147270">thing.</span> <span m="4148060">There's</span> <span m="4148100">a</span> <span m="4148149">lot</span> <span m="4148460">of</span> <span m="4148500">criteria</span> <span m="4149170">you</span> <span m="4149260">can</span> <span m="4149420">make.</span> </p>
<p><span m="4150649">This</span> <span m="4151130">one</span> <span m="4152250">turns</span> <span m="4152600">out</span> <span m="4152750">to</span> <span m="4152810">be</span> <span m="4152910">useful</span> <span m="4153340">in</span> <span m="4153410">practice</span> <span m="4153950">in</span> <span m="4154029">a</span> <span m="4154060">variety</span> <span m="4154439">ways</span> <span m="4154720">that</span> <span m="4154850">we'll</span> <span m="4154970">talk</span> <span m="4155200">about,</span> <span m="4155960">and</span> <span m="4156229">also</span> <span m="4156510">have</span> <span m="4156609">a</span> <span m="4157010">nice,</span> <span m="4157550">fast,</span> <span m="4157970">simple</span> <span m="4158200">algorithm</span> <span m="4158790">that</span> <span m="4158859">can</span> <span m="4158970">actually</span> <span m="4159319">run</span> <span m="4159649">in a</span> <span m="4159720">distributed</span> <span m="4160390">environment,</span> <span m="4161010">which</span> <span m="4161069">is</span> <span m="4161160">really</span> <span m="4161399">nice.</span> <span m="4162830">So</span> <span m="4162920">it</span> <span m="4163010">is</span> <span m="4163840">probably</span> <span m="4164390">the</span> <span m="4164470">most</span> <span m="4164700">practical</span> <span m="4165130">approach</span> <span m="4165529">to</span> <span m="4165630">matching</span> <span m="4166060">out</span> <span m="4166170">there.</span> <span m="4168279">Any</span> <span m="4168430">other</span> <span m="4169020">questions?</span> </p>
<p><span m="4171930">OK,</span> <span m="4172240">the</span> <span m="4172390">last</span> <span m="4172810">issue--</span> <span m="4173215">I</span> <span m="4173620">don't know</span> <span m="4173746">if</span> <span m="4173873">we</span> <span m="4174000">still have</span> <span m="4174180">the</span> <span m="4174310">issues</span> <span m="4174620">up</span> <span m="4174770">there--</span> <span m="4175540">is</span> <span m="4175790">fairness.</span> <span m="4178649">So</span> <span m="4178800">who</span> <span m="4179109">thinks</span> <span m="4180560">the</span> <span m="4180670">TMA</span> <span m="4181819">is</span> <span m="4182189">favorable</span> <span m="4182800">to</span> <span m="4182890">the</span> <span m="4183010">boys?</span> <span m="4186040">Just</span> <span m="4186250">a</span> <span m="4186300">couple.</span> </p>
<p><span m="4186630">Who</span> <span m="4186830">thinks</span> <span m="4187109">it's</span> <span m="4187279">favorable</span> <span m="4187800">to</span> <span m="4187840">the</span> <span m="4187970">girls?</span> <span m="4189990">More,</span> <span m="4190350">that's</span> <span m="4190590">the</span> <span m="4190649">common</span> <span m="4191010">response.</span> <span m="4191899">Who</span> <span m="4192050">thinks</span> <span m="4192859">you</span> <span m="4192979">can't</span> <span m="4193210">even</span> <span m="4193380">define</span> <span m="4193729">it</span> <span m="4193810">one</span> <span m="4193970">way</span> <span m="4194069">or</span> <span m="4194170">the</span> <span m="4194310">other?</span> <span m="4194510">It's</span> <span m="4194650">unclear</span> <span m="4194940">and</span> <span m="4195720">hopeless</span> <span m="4196040">to</span> <span m="4196100">decide.</span> </p>
<p><span m="4197450">OK,</span> <span m="4198540">well,</span> <span m="4200320">it</span> <span m="4200420">seems</span> <span m="4200840">like</span> <span m="4201010">maybe</span> <span m="4201230">the</span> <span m="4201340">girls,</span> <span m="4201840">because</span> <span m="4202110">they</span> <span m="4202270">get</span> <span m="4202430">the</span> <span m="4202520">best</span> <span m="4202960">of</span> <span m="4203020">their</span> <span m="4203150">suitors.</span> <span m="4204170">They</span> <span m="4204300">sit</span> <span m="4204570">back,</span> <span m="4204970">and</span> <span m="4205090">they</span> <span m="4205170">just</span> <span m="4205360">take</span> <span m="4205530">the</span> <span m="4205600">best</span> <span m="4205920">as</span> <span m="4206000">they</span> <span m="4206100">come</span> <span m="4206290">along.</span> <span m="4207770">On</span> <span m="4207930">the</span> <span m="4208030">other</span> <span m="4208180">hand,</span> <span m="4208540">the</span> <span m="4208640">boys</span> <span m="4209000">do</span> <span m="4209230">try</span> <span m="4209700">to</span> <span m="4209810">go out</span> <span m="4210010">and</span> <span m="4210140">get</span> <span m="4210360">their</span> <span m="4210490">first</span> <span m="4210780">choice.</span> <span m="4211690">The</span> <span m="4211790">girls</span> <span m="4212020">have</span> <span m="4212170">to</span> <span m="4212280">wait.</span> <span m="4213080">And</span> <span m="4213330">Mr.</span> <span m="4213610">Right</span> <span m="4213880">may</span> <span m="4213980">never</span> <span m="4214200">come</span> <span m="4214390">along.</span> </p>
<p><span m="4215440">The</span> <span m="4215540">boys</span> <span m="4215900">are</span> <span m="4216010">out</span> <span m="4216200">there.</span> <span m="4216360">I'm</span> <span m="4216470">going</span> <span m="4216730">to</span> <span m="4216810">my</span> <span m="4216930">first</span> <span m="4217220">choice,</span> <span m="4218070">and</span> <span m="4218970">they</span> <span m="4219070">get</span> <span m="4219300">denied,</span> <span m="4219680">OK,</span> <span m="4219990">they</span> <span m="4220160">just</span> <span m="4220430">move</span> <span m="4220610">right</span> <span m="4220820">on to</span> <span m="4221130">the</span> <span m="4221190">next</span> <span m="4221420">choice.</span> <span m="4222670">So</span> <span m="4222790">this</span> <span m="4222980">is</span> <span m="4223120">actually</span> <span m="4223750">one</span> <span m="4223970">of</span> <span m="4224010">these</span> <span m="4224190">questions</span> <span m="4224620">of</span> <span m="4224700">study in</span> <span m="4225140">sociology.</span> <span m="4226780">In</span> <span m="4226970">the</span> <span m="4227100">animal</span> <span m="4227420">species,</span> <span m="4228830">which</span> <span m="4229090">is</span> <span m="4229200">better,</span> <span m="4229720">proposers</span> <span m="4230230">or</span> <span m="4230440">acceptors?</span> <span m="4231550">What's</span> <span m="4231780">the</span> <span m="4231860">more</span> <span m="4232030">powerful</span> <span m="4233080">result?</span> <span m="4233800">Who</span> <span m="4233970">has</span> <span m="4234130">the</span> <span m="4234190">better</span> <span m="4234430">power in</span> <span m="4234860">courtship?</span> </p>
<p><span m="4236490">It</span> <span m="4236660">turns</span> <span m="4236990">out</span> <span m="4237400">that</span> <span m="4237680">we</span> <span m="4237870">can</span> <span m="4238040">answer</span> <span m="4238400">this</span> <span m="4238610">question</span> <span m="4239210">in</span> <span m="4239330">a</span> <span m="4239370">very</span> <span m="4240000">clear</span> <span m="4240300">way,</span> <span m="4240910">and</span> <span m="4241070">prove</span> <span m="4241330">it</span> <span m="4241380">here.</span> <span m="4242540">And</span> <span m="4243010">the</span> <span m="4243150">answer</span> <span m="4243550">is</span> <span m="4244450">the</span> <span m="4244550">boys</span> <span m="4244990">have</span> <span m="4245170">all</span> <span m="4245550">the</span> <span m="4245650">power</span> <span m="4246040">here.</span> <span m="4246570">This</span> <span m="4246760">is</span> <span m="4246880">very</span> <span m="4247310">favorable</span> <span m="4247740">to</span> <span m="4247830">the</span> <span m="4247920">boys,</span> <span m="4248670">and</span> <span m="4248870">we'll</span> <span m="4248980">see</span> <span m="4249190">why.</span> </p>
<p><span m="4250300">Now,</span> <span m="4250580">to</span> <span m="4250700">prove</span> <span m="4251090">that,</span> <span m="4251410">we</span> <span m="4251500">need</span> <span m="4251710">some</span> <span m="4252800">definitions.</span> <span m="4274190">OK,</span> <span m="4275800">so</span> <span m="4276800">I've got</span> <span m="4277000">to</span> <span m="4277060">define</span> <span m="4277420">a</span> <span m="4277470">couple</span> <span m="4277760">things</span> <span m="4278000">here</span> <span m="4278120">to</span> <span m="4278180">be</span> <span m="4278240">able</span> <span m="4278350">to</span> <span m="4278420">prove</span> <span m="4278730">this.</span> <span m="4279070">The</span> <span m="4279170">first</span> <span m="4279400">is,</span> <span m="4279560">for</span> <span m="4279740">any</span> <span m="4280000">collection</span> <span m="4280430">of</span> <span m="4280500">preference</span> <span m="4281090">lists,</span> <span m="4282540">we're</span> <span m="4282710">going</span> <span m="4282820">to</span> <span m="4282890">let</span> <span m="4283200">S</span> <span m="4284340">be</span> <span m="4284710">the</span> <span m="4284870">set</span> <span m="4286800">of</span> <span m="4287350">all</span> <span m="4288400">stable</span> <span m="4288890">matchings.</span> <span m="4296500">Now,</span> <span m="4296710">we</span> <span m="4296860">know</span> <span m="4297330">that</span> <span m="4298010">S</span> <span m="4298320">is</span> <span m="4298430">not</span> <span m="4298670">empty,</span> <span m="4299050">right?</span> <span m="4300090">How</span> <span m="4300250">do</span> <span m="4300300">we</span> <span m="4300400">know</span> <span m="4300540">that</span> <span m="4300680">S</span> <span m="4300930">is</span> <span m="4301050">not empty</span> <span m="4301541">here?</span> </p>
<p><span m="4303014">AUDIENCE:</span> <span m="4303505">[INAUDIBLE]</span> <span m="4303996">stable.</span> </p>
<p><span m="4304980">PROFESSOR: Yeah,</span> <span m="4305130">because</span> <span m="4305280">TMA</span> <span m="4305950">produces</span> <span m="4306340">a</span> <span m="4306390">stable</span> <span m="4306700">matching,</span> <span m="4307240">so</span> <span m="4307270">we</span> <span m="4307390">know</span> <span m="4307740">that</span> <span m="4307880">S</span> <span m="4308120">is</span> <span m="4308230">not</span> <span m="4308420">empty.</span> <span m="4309350">There's</span> <span m="4309570">at</span> <span m="4309670">least</span> <span m="4309950">one.</span> <span m="4311780">And,</span> <span m="4312150">in</span> <span m="4312280">fact,</span> <span m="4312550">there</span> <span m="4312660">could</span> <span m="4312860">be</span> <span m="4313150">many.</span> </p>
<p><span m="4314890">Now,</span> <span m="4315080">for</span> <span m="4315260">each</span> <span m="4315500">person,</span> <span m="4320970">P,</span> <span m="4323420">we</span> <span m="4323510">define</span> <span m="4326800">the</span> <span m="4327080">realm</span> <span m="4327820">of</span> <span m="4327980">possibility</span> <span m="4339310">for</span> <span m="4339620">P</span> <span m="4341910">to be</span> <span m="4343570">the</span> <span m="4343690">set</span> <span m="4344836">of</span> <span m="4345530">mates</span> <span m="4346970">that</span> <span m="4347130">you</span> <span m="4347260">might</span> <span m="4347530">have</span> <span m="4348100">in</span> <span m="4348270">a</span> <span m="4348330">stable</span> <span m="4348640">matching.</span> <span m="4350040">So</span> <span m="4350260">it's</span> <span m="4350380">a</span> <span m="4350430">set</span> <span m="4350790">queue</span> <span m="4351180">of</span> <span m="4351280">people</span> <span m="4352150">for</span> <span m="4352290">which</span> <span m="4352520">there</span> <span m="4352650">exists</span> <span m="4353290">a</span> <span m="4353380">matching</span> <span m="4354100">that's</span> <span m="4354220">stable</span> <span m="4356130">such</span> <span m="4356460">that</span> <span m="4356990">you're</span> <span m="4357660">mated</span> <span m="4357940">to</span> <span m="4358110">that</span> <span m="4358330">person.</span> <span m="4360890">So</span> <span m="4360910">I've</span> <span m="4361060">written</span> <span m="4361370">this</span> <span m="4361630">in</span> <span m="4361770">some--</span> <span m="4362340">that's</span> <span m="4362560">sort</span> <span m="4362770">of</span> <span m="4362850">complicated</span> <span m="4363420">mathematics,</span> <span m="4365020">but</span> <span m="4365240">somebody</span> <span m="4365490">is</span> <span m="4365540">in</span> <span m="4365840">your</span> <span m="4366030">realm</span> <span m="4366300">of</span> <span m="4366390">possibility</span> <span m="4368090">if</span> <span m="4368300">there</span> <span m="4368470">is</span> <span m="4368640">a</span> <span m="4368710">stable</span> <span m="4369040">matching</span> <span m="4369450">where</span> <span m="4369530">you</span> <span m="4369650">married</span> <span m="4369950">them.</span> <span m="4370620">If</span> <span m="4370770">it</span> <span m="4370860">exists,</span> <span m="4371460">there's</span> <span m="4371560">a</span> <span m="4371630">stable</span> <span m="4371970">matching</span> <span m="4372165">where</span> <span m="4372360">you</span> <span m="4372500">could</span> <span m="4372650">marry</span> <span m="4372890">them.</span> </p>
<p><span m="4373830">And</span> <span m="4373990">this</span> <span m="4374120">is</span> <span m="4375020">vaguely</span> <span m="4375580">like</span> <span m="4376340">you</span> <span m="4376510">see</span> <span m="4376700">sometimes,</span> <span m="4377140">you're</span> <span m="4377670">going</span> <span m="4377920">out</span> <span m="4378050">with</span> <span m="4378170">somebody</span> <span m="4378570">and</span> <span m="4378670">your</span> <span m="4378820">parents</span> <span m="4379200">say,</span> <span m="4379320">oh,</span> <span m="4379700">they're</span> <span m="4379850">not</span> <span m="4380080">in</span> <span m="4380140">your</span> <span m="4380300">league,</span> <span m="4380660">or</span> <span m="4380760">something.</span> <span m="4382350">This</span> <span m="4382590">is</span> <span m="4382680">a</span> <span m="4382740">mathematical</span> <span m="4383430">formulation</span> <span m="4384060">for</span> <span m="4384150">that,</span> <span m="4384910">that</span> <span m="4386270">there</span> <span m="4386430">is</span> <span m="4386640">some</span> <span m="4386990">way</span> <span m="4387170">in</span> <span m="4387260">the</span> <span m="4387350">world</span> <span m="4387660">to</span> <span m="4387740">marry</span> <span m="4388000">everybody</span> <span m="4388540">up,</span> <span m="4388660">so</span> <span m="4388780">it's</span> <span m="4389030">all</span> <span m="4389440">stable,</span> <span m="4390050">and</span> <span m="4390250">you</span> <span m="4390380">could</span> <span m="4390610">be</span> <span m="4390740">married</span> <span m="4391050">to</span> <span m="4391110">that</span> <span m="4391280">person.</span> <span m="4392680">OK?</span> <span m="4394760">Let's</span> <span m="4395170">do</span> <span m="4395280">an</span> <span m="4395340">example</span> <span m="4395790">with</span> <span m="4398070">four</span> <span m="4398330">people.</span> </p>
<p><span m="4411090">All</span> <span m="4411280">right,</span> <span m="4411430">so</span> <span m="4411540">for</span> <span m="4411660">example,</span> <span m="4412100">say</span> <span m="4412300">we</span> <span m="4412430">have</span> <span m="4414180">Brad,</span> <span m="4417440">Jen,</span> <span m="4419170">and</span> <span m="4419300">Angelina</span> <span m="4419920">again.</span> <span m="4422420">And</span> <span m="4422560">of</span> <span m="4422600">course</span> <span m="4423200">Brad</span> <span m="4423560">likes</span> <span m="4423810">Angelina</span> <span m="4424320">and</span> <span m="4424460">vice</span> <span m="4424720">versa.</span> <span m="4425800">Gen</span> <span m="4426070">likes</span> <span m="4426360">Brad,</span> <span m="4428030">and</span> <span m="4428120">then</span> <span m="4428250">there's</span> <span m="4428500">Billy</span> <span m="4428770">Bob</span> <span m="4429080">here.</span> <span m="4432720">All</span> <span m="4432800">right.</span> </p>
<p><span m="4433790">Now,</span> <span m="4434750">Brad</span> <span m="4435660">is</span> <span m="4435870">not</span> <span m="4436320">realistic</span> <span m="4436960">for</span> <span m="4437070">Jen.</span> <span m="4438330">Brad</span> <span m="4438750">Is</span> <span m="4438950">not</span> <span m="4439400">in</span> <span m="4439540">Jen's</span> <span m="4440040">realm</span> <span m="4440400">of</span> <span m="4440480">possibility,</span> <span m="4442350">because</span> <span m="4442700">in</span> <span m="4443610">any</span> <span m="4443840">perfect</span> <span m="4444140">matching</span> <span m="4444550">where</span> <span m="4444650">Brad</span> <span m="4445000">marries</span> <span m="4445330">Jen,</span> <span m="4447120">you're</span> <span m="4447280">going</span> <span m="4447390">to</span> <span m="4447460">have</span> <span m="4448100">a</span> <span m="4448180">rogue</span> <span m="4448420">couple.</span> <span m="4450490">Brad's</span> <span m="4450840">going</span> <span m="4450950">to</span> <span m="4451000">go</span> <span m="4451220">for</span> <span m="4451400">Angelina.</span> <span m="4452820">So</span> <span m="4452970">Brad</span> <span m="4453350">is</span> <span m="4453520">not</span> <span m="4453920">within</span> <span m="4454170">Jen's</span> <span m="4454590">realm</span> <span m="4454940">of</span> <span m="4455020">possibility.</span> </p>
<p><span m="4457170">And</span> <span m="4457330">similarly,</span> <span m="4458000">vice</span> <span m="4458270">versa--</span> <span m="4458720">Jen is</span> <span m="4459160">not</span> <span m="4459350">in</span> <span m="4459410">Brad's</span> <span m="4459790">realm of</span> <span m="4460040">possibility,</span> <span m="4461790">because</span> <span m="4461960">there's</span> <span m="4462130">no</span> <span m="4462420">stable</span> <span m="4462790">matching</span> <span m="4463160">where</span> <span m="4463240">they're</span> <span m="4463410">married,</span> <span m="4463990">in</span> <span m="4464110">this</span> <span m="4464290">scenario,</span> <span m="4464720">for</span> <span m="4464830">this</span> <span m="4465000">problem.</span> <span m="4466910">All</span> <span m="4467000">right?</span> <span m="4469300">Now that</span> <span m="4469500">we</span> <span m="4469690">have</span> <span m="4469950">that</span> <span m="4470270">notion,</span> <span m="4470660">we</span> <span m="4470780">can</span> <span m="4470900">define</span> <span m="4471590">who</span> <span m="4472010">your</span> <span m="4472180">optimal</span> <span m="4472660">mate is,</span> <span m="4473970">and</span> <span m="4474080">who</span> <span m="4474250">your</span> <span m="4474510">pessimal</span> <span m="4475080">mate</span> <span m="4475340">is,</span> <span m="4475828">the worst</span> <span m="4476316">case.</span> </p>
<p><span m="4491950">All</span> <span m="4492110">right,</span> <span m="4492300">so</span> <span m="4492500">we</span> <span m="4492590">define</span> <span m="4495910">a</span> <span m="4496050">person's</span> <span m="4498660">optimal</span> <span m="4499230">mate</span> <span m="4506800">is</span> <span m="4507150">his</span> <span m="4507880">or</span> <span m="4508090">her</span> <span m="4509760">favorite</span> <span m="4511080">in</span> <span m="4511240">the</span> <span m="4511380">realm</span> <span m="4511760">of</span> <span m="4511870">possibility.</span> <span m="4522890">So</span> <span m="4523040">your</span> <span m="4523190">optimal</span> <span m="4523690">mate</span> <span m="4523940">is</span> <span m="4524090">not</span> <span m="4524370">your</span> <span m="4524490">favorite</span> <span m="4525240">overall,</span> <span m="4526730">it's</span> <span m="4526970">just</span> <span m="4527220">your</span> <span m="4527350">favorite</span> <span m="4527840">among</span> <span m="4528140">those</span> <span m="4528550">who</span> <span m="4528720">are</span> <span m="4529030">possible,</span> <span m="4529730">that</span> <span m="4529860">there</span> <span m="4530030">is</span> <span m="4530260">a</span> <span m="4530330">stable</span> <span m="4530670">matching</span> <span m="4530925">that</span> <span m="4531180">you</span> <span m="4531340">could</span> <span m="4532160">be</span> <span m="4532280">matched</span> <span m="4532600">to</span> <span m="4532660">that</span> <span m="4532840">person.</span> </p>
<p><span m="4534330">And</span> <span m="4534510">similarly,</span> <span m="4536960">you</span> <span m="4537090">have</span> <span m="4537290">a</span> <span m="4537380">person's</span> <span m="4537940">pessimal</span> <span m="4538520">mate</span> <span m="4543860">is</span> <span m="4544160">your</span> <span m="4544440">least</span> <span m="4544950">favorite</span> <span m="4548410">from</span> <span m="4548810">the</span> <span m="4548930">realm</span> <span m="4549210">of</span> <span m="4549300">possibility.</span> <span m="4551660">OK?</span> <span m="4551950">Because</span> <span m="4552480">you</span> <span m="4552570">have</span> <span m="4552680">all</span> <span m="4552880">the</span> <span m="4552990">people</span> <span m="4553320">you</span> <span m="4553480">might</span> <span m="4553830">be</span> <span m="4553940">married</span> <span m="4554320">to</span> <span m="4554530">in</span> <span m="4555390">stable</span> <span m="4555670">matchings.</span> <span m="4556900">Your</span> <span m="4557030">favorite</span> <span m="4557400">is</span> <span m="4557490">the</span> <span m="4557620">optimal,</span> <span m="4558160">your</span> <span m="4558290">least</span> <span m="4558550">favorite</span> <span m="4558830">is</span> <span m="4558930">the</span> <span m="4559020">pessimal.</span> </p>
<p><span m="4560590">Any</span> <span m="4560740">questions</span> <span m="4561140">about</span> <span m="4561370">that?</span> <span m="4562090">Does that</span> <span m="4562250">make</span> <span m="4562480">sense?</span> <span m="4564340">And</span> <span m="4564440">you</span> <span m="4564510">don't</span> <span m="4564680">count</span> <span m="4564930">the</span> <span m="4565020">ones</span> <span m="4565300">you</span> <span m="4565570">can't</span> <span m="4565830">be</span> <span m="4565930">married</span> <span m="4566240">to,</span> <span m="4566370">because</span> <span m="4566550">if</span> <span m="4566640">you</span> <span m="4566770">were,</span> <span m="4567690">it</span> <span m="4567810">would</span> <span m="4567910">be</span> <span m="4568010">unstable.</span> </p>
<p><span m="4571270">OK,</span> <span m="4571560">now</span> <span m="4571880">we</span> <span m="4571990">can</span> <span m="4572180">state</span> <span m="4572740">the</span> <span m="4572820">blockbuster</span> <span m="4573460">theorems</span> <span m="4573910">here.</span> <span m="4576800">Theorem</span> <span m="4576820">four</span> <span m="4577460">says</span> <span m="4578806">TMA</span> <span m="4581550">marries</span> <span m="4583980">every</span> <span m="4584360">boy</span> <span m="4588370">with</span> <span m="4590240">his</span> <span m="4590600">optimal</span> <span m="4591160">mate.</span> <span m="4596630">Theorem</span> <span m="4596940">five,</span> <span m="4599580">probably</span> <span m="4599820">can</span> <span m="4599990">guess,</span> <span m="4601140">TMA</span> <span m="4601650">marries</span> <span m="4602180">every</span> <span m="4602570">girl</span> <span m="4605930">with</span> <span m="4606260">her</span> <span m="4607290">pessimal</span> <span m="4607850">mate.</span> </p>
<p><span m="4613900">All</span> <span m="4614090">right,</span> <span m="4614360">so</span> <span m="4614560">it</span> <span m="4614640">is</span> <span m="4615050">optimal</span> <span m="4615690">for</span> <span m="4615950">every</span> <span m="4616300">boy.</span> <span m="4616610">They</span> <span m="4616740">get</span> <span m="4616910">the</span> <span m="4616990">best</span> <span m="4617440">possible</span> <span m="4617890">they</span> <span m="4618010">could</span> <span m="4618140">have</span> <span m="4618450">in stable</span> <span m="4618880">marriages,</span> <span m="4619960">and</span> <span m="4620100">every</span> <span m="4620360">girl</span> <span m="4621090">gets</span> <span m="4621300">the</span> <span m="4621420">worst</span> <span m="4621820">possible</span> <span m="4622320">mate.</span> <span m="4623306">Now,</span> <span m="4623650">you</span> <span m="4623820">wouldn't</span> <span m="4624030">necessarily</span> <span m="4624315">think</span> <span m="4624900">that</span> <span m="4625570">when</span> <span m="4625710">you</span> <span m="4625800">first</span> <span m="4626110">look</span> <span m="4626260">at</span> <span m="4626330">that</span> <span m="4626510">algorithm,</span> <span m="4628240">where</span> <span m="4628360">the</span> <span m="4628420">boys</span> <span m="4628780">are</span> <span m="4628850">working</span> <span m="4629200">down</span> <span m="4629320">their</span> <span m="4629450">list,</span> <span m="4629750">and</span> <span m="4629790">the</span> <span m="4629850">girls</span> <span m="4630180">are</span> <span m="4630230">just</span> <span m="4630420">getting</span> <span m="4630630">better</span> <span m="4630880">and</span> <span m="4630970">better.</span> <span m="4632070">But</span> <span m="4632190">that's</span> <span m="4632420">the</span> <span m="4632510">case.</span> </p>
<p><span m="4633090">Now,</span> <span m="4634020">let's</span> <span m="4634270">see,</span> <span m="4634430">I'm</span> <span m="4634600">not</span> <span m="4634820">going</span> <span m="4634920">to</span> <span m="4634960">have</span> <span m="4635070">time</span> <span m="4635390">to</span> <span m="4635470">prove</span> <span m="4635680">them</span> <span m="4635840">both,</span> <span m="4636220">but</span> <span m="4636360">I</span> <span m="4636470">will</span> <span m="4636760">prove</span> <span m="4637990">theorem</span> <span m="4638330">five.</span> <span m="4639940">And I'm</span> <span m="4640110">going</span> <span m="4640200">to</span> <span m="4640240">assume</span> <span m="4640610">theorem</span> <span m="4640930">four</span> <span m="4641240">is</span> <span m="4641340">true</span> <span m="4641900">to</span> <span m="4642000">prove</span> <span m="4642240">theorem</span> <span m="4642510">five.</span> <span m="4643860">Maybe</span> <span m="4644050">we'll</span> <span m="4644230">do</span> <span m="4645230">theorem</span> <span m="4645520">four</span> <span m="4645760">tomorrow in</span> <span m="4646100">recitation.</span> <span m="4646660">I</span> <span m="4646710">don't</span> <span m="4646830">know.</span> <span m="4647660">So</span> <span m="4647820">let's</span> <span m="4648020">do</span> <span m="4648150">theorem</span> <span m="4648470">five so</span> <span m="4648860">you can see how</span> <span m="4649353">this</span> <span m="4649846">works.</span> </p>
<p><span m="4653300">The</span> <span m="4653430">proof</span> <span m="4653800">is</span> <span m="4653950">by</span> <span m="4655889">contradiction,</span> <span m="4667500">so</span> <span m="4667800">we'll</span> <span m="4667920">assume</span> <span m="4668310">theorem</span> <span m="4668580">four is</span> <span m="4668890">true,</span> <span m="4669100">and we'll</span> <span m="4669250">prove</span> <span m="4669550">the</span> <span m="4669630">proof</span> <span m="4669900">of</span> <span m="4670020">theorem</span> <span m="4670290">five</span> <span m="4674420">by</span> <span m="4674570">contradiction.</span> <span m="4683040">So</span> <span m="4683490">assume</span> <span m="4683980">there</span> <span m="4684100">was</span> <span m="4684520">a</span> <span m="4684600">stable</span> <span m="4684970">matching</span> <span m="4686820">where</span> <span m="4687070">a</span> <span m="4687140">girl</span> <span m="4688700">got</span> <span m="4689040">worse</span> <span m="4689590">off</span> <span m="4689930">than</span> <span m="4690050">in TMA.</span> <span m="4692290">All</span> <span m="4692360">right?</span> <span m="4694060">Assume</span> <span m="4694900">three and five</span> <span m="4695300">is</span> <span m="4695390">not</span> <span m="4695590">true,</span> <span m="4695900">then</span> <span m="4695960">there's</span> <span m="4696150">some</span> <span m="4696450">girl</span> <span m="4696870">in</span> <span m="4697030">some</span> <span m="4697230">stable</span> <span m="4697530">matching.</span> </p>
<p><span m="4699680">So</span> <span m="4699870">suppose,</span> <span m="4700370">for</span> <span m="4700450">the</span> <span m="4700550">purpose</span> <span m="4700830">of</span> <span m="4700900">contradiction,</span> <span m="4702270">that</span> <span m="4703300">there</span> <span m="4703540">exists</span> <span m="4703970">a</span> <span m="4704050">stable</span> <span m="4704460">matching,</span> <span m="4710230">we'll call</span> <span m="4710540">it</span> <span m="4710640">M,</span> <span m="4712520">where</span> <span m="4712760">some</span> <span m="4713100">girl,</span> <span m="4720760">and</span> <span m="4720950">she</span> <span m="4721150">fares</span> <span m="4721600">worse</span> <span m="4721885">than</span> <span m="4722170">in</span> <span m="4722350">TMA.</span> <span m="4728440">I</span> <span m="4728570">want</span> <span m="4728720">to</span> <span m="4728770">show</span> <span m="4728990">that</span> <span m="4729240">results</span> <span m="4729640">in</span> <span m="4729720">a</span> <span m="4729770">contradiction.</span> <span m="4733120">And</span> <span m="4733350">the</span> <span m="4733430">proof</span> <span m="4733720">is</span> <span m="4733880">pretty</span> <span m="4734200">simple,</span> <span m="4734680">just a</span> <span m="4735114">simple</span> <span m="4735548">picture.</span> <span m="4740820">So</span> <span m="4741090">G</span> <span m="4742090">did</span> <span m="4742330">worse</span> <span m="4743050">in</span> <span m="4743210">M</span> <span m="4743510">than in</span> <span m="4743810">TMA.</span> </p>
<p><span m="4754480">All</span> <span m="4754620">right,</span> <span m="4754910">so</span> <span m="4755040">let's</span> <span m="4755400">let</span> <span m="4756400">B</span> <span m="4756830">prime</span> <span m="4759180">be</span> <span m="4759360">the</span> <span m="4759480">mate</span> <span m="4760290">of</span> <span m="4760530">G</span> <span m="4761880">in</span> <span m="4762060">M.</span> <span m="4764475">So</span> <span m="4764960">girl</span> <span m="4765280">G</span> <span m="4765710">did</span> <span m="4765890">worse</span> <span m="4766370">in</span> <span m="4766490">M than in</span> <span m="4766950">TMA,</span> <span m="4767490">so</span> <span m="4767670">here's</span> <span m="4768690">her</span> <span m="4768820">mate</span> <span m="4769490">in</span> <span m="4769710">M,</span> <span m="4770550">and</span> <span m="4770970">let</span> <span m="4771350">B</span> <span m="4771700">be</span> <span m="4771920">her</span> <span m="4772100">mate</span> <span m="4772530">in</span> <span m="4772680">TMA.</span> <span m="4778080">Who</span> <span m="4778280">does</span> <span m="4778420">she</span> <span m="4778600">like</span> <span m="4778860">better,</span> <span m="4779460">B or</span> <span m="4779900">B</span> <span m="4780080">prime?</span> <span m="4782510">B,</span> <span m="4782800">because</span> <span m="4783120">we're</span> <span m="4783220">saying</span> <span m="4783810">that</span> <span m="4783950">she</span> <span m="4784110">did</span> <span m="4784310">worse</span> <span m="4784800">in</span> <span m="4784940">M</span> <span m="4785260">than</span> <span m="4785370">she</span> <span m="4785480">did in</span> <span m="4785720">TMA,</span> <span m="4786150">so</span> <span m="4787040">she</span> <span m="4787320">likes</span> <span m="4788160">B</span> <span m="4788430">better.</span> </p>
<p><span m="4791540">And</span> <span m="4791790">let</span> <span m="4792150">G</span> <span m="4792520">prime</span> <span m="4794630">be</span> <span m="4794770">the</span> <span m="4794880">mate</span> <span m="4795570">of</span> <span m="4795850">B</span> <span m="4796700">in</span> <span m="4796860">M.</span> <span m="4799668">Now,</span> <span m="4800140">who</span> <span m="4800380">does</span> <span m="4800580">B</span> <span m="4800850">like</span> <span m="4801110">better,</span> <span m="4801820">G</span> <span m="4802300">or</span> <span m="4802460">G</span> <span m="4802680">prime?</span> </p>
<p><span m="4803270">[INTERPOSING VOICES]</span> </p>
<p><span m="4807500">PROFESSOR: Not</span> <span m="4807780">G</span> <span m="4808010">prime.</span> <span m="4808840">B</span> <span m="4809070">got</span> <span m="4809330">married to</span> <span m="4809730">G</span> <span m="4809870">prime</span> <span m="4810140">in M,</span> <span m="4810410">but</span> <span m="4812880">what</span> <span m="4813070">does</span> <span m="4813140">theorem</span> <span m="4813450">four</span> <span m="4813780">say?</span> <span m="4815740">Yeah,</span> <span m="4816150">G.</span> <span m="4816730">Theorem</span> <span m="4817110">four</span> <span m="4817420">says</span> <span m="4818390">that</span> <span m="4818990">across</span> <span m="4819330">all</span> <span m="4819560">the</span> <span m="4819660">stable</span> <span m="4820000">matchings,</span> <span m="4821040">B</span> <span m="4821300">gets</span> <span m="4821560">his</span> <span m="4821740">favorite</span> <span m="4822260">mate</span> <span m="4822650">in TMA.</span> <span m="4824780">So</span> <span m="4826080">G</span> <span m="4826330">prime</span> <span m="4826680">is in</span> <span m="4826780">the</span> <span m="4826880">realm</span> <span m="4827060">of</span> <span m="4827150">possibility,</span> <span m="4827710">and</span> <span m="4827810">so</span> <span m="4828040">is</span> <span m="4828160">G,</span> <span m="4828480">and</span> <span m="4828540">we</span> <span m="4828650">know</span> <span m="4828910">from</span> <span m="4829060">theorem</span> <span m="4829330">four</span> <span m="4830180">B</span> <span m="4830400">likes</span> <span m="4830710">G</span> <span m="4830890">best,</span> <span m="4831530">better than G</span> <span m="4832000">prime,</span> <span m="4832680">because</span> <span m="4832930">of</span> <span m="4833030">theorem</span> <span m="4833280">four.</span> </p>
<p><span m="4835100">So</span> <span m="4835430">what</span> <span m="4835620">happened</span> <span m="4835990">here?</span> <span m="4838260">There's</span> <span m="4838470">a</span> <span m="4838580">rogue</span> <span m="4838910">couple</span> <span m="4839350">in</span> <span m="4839420">M.</span> <span m="4840850">B and</span> <span m="4840950">G</span> <span m="4842858">are</span> <span m="4843310">a</span> <span m="4843400">rogue</span> <span m="4843730">couple</span> <span m="4847450">in</span> <span m="4848080">M.</span> </p>
<p><span m="4849620">And</span> <span m="4849650">that</span> <span m="4849880">means</span> <span m="4850180">that</span> <span m="4850280">M</span> <span m="4850530">is</span> <span m="4850660">not</span> <span m="4850880">stable,</span> <span m="4853380">and</span> <span m="4853540">that</span> <span m="4853790">is</span> <span m="4853900">a</span> <span m="4853960">contradiction.</span> <span m="4857700">All</span> <span m="4857830">right?</span> <span m="4858050">And</span> <span m="4858180">so</span> <span m="4858320">theorem</span> <span m="4858630">five is true,</span> <span m="4863240">because</span> <span m="4863560">we</span> <span m="4864010">assumed</span> <span m="4864700">we</span> <span m="4864850">had</span> <span m="4864960">a</span> <span m="4865010">stable</span> <span m="4865400">matching</span> <span m="4865800">M</span> <span m="4866820">where</span> <span m="4866920">there's</span> <span m="4867090">a</span> <span m="4867140">girl</span> <span m="4867360">who</span> <span m="4867460">did</span> <span m="4867620">worse</span> <span m="4867890">off.</span> </p>
<p><span m="4870810">So</span> <span m="4870990">it</span> <span m="4871070">really</span> <span m="4871410">pays</span> <span m="4871730">off</span> <span m="4871950">to</span> <span m="4872050">be</span> <span m="4872240">aggressive</span> <span m="4872730">party</span> <span m="4872830">in</span> <span m="4873180">courtship.</span> <span m="4874560">Everybody lives</span> <span m="4875240">happily</span> <span m="4875630">ever</span> <span m="4875830">after,</span> <span m="4876220">especially</span> <span m="4876970">the</span> <span m="4877070">boys</span> <span m="4877640">in</span> <span m="4877820">TMA.</span> <span m="4879030">Now,</span> <span m="4879200">TMA</span> <span m="4879650">arises</span> <span m="4880180">in</span> <span m="4880280">lots</span> <span m="4880520">of</span> <span m="4880630">applications.</span> <span m="4882060">The</span> <span m="4882170">most</span> <span m="4882480">famous</span> <span m="4883040">is</span> <span m="4883840">the</span> <span m="4884000">matching</span> <span m="4884490">program</span> <span m="4884910">that's</span> <span m="4885000">used</span> <span m="4885290">to</span> <span m="4885380">match</span> <span m="4885750">MDs</span> <span m="4886550">to</span> <span m="4886670">residency</span> <span m="4887190">programs.</span> </p>
<p><span m="4888480">So</span> <span m="4888730">how</span> <span m="4888890">many</span> <span m="4889080">pre-meds</span> <span m="4889570">are</span> <span m="4889650">here?</span> <span m="4891590">There's</span> <span m="4892020">one,</span> <span m="4892380">at</span> <span m="4892480">least.</span> <span m="4893380">So</span> <span m="4893760">you're</span> <span m="4893920">going</span> <span m="4894020">to</span> <span m="4894060">go</span> <span m="4894170">to</span> <span m="4894250">medical</span> <span m="4894680">school</span> <span m="4894930">some</span> <span m="4895170">day,</span> <span m="4895670">and</span> <span m="4895870">at</span> <span m="4896040">the</span> <span m="4896140">end</span> <span m="4896240">of</span> <span m="4896310">medical</span> <span m="4896740">school,</span> <span m="4896950">there's</span> <span m="4897100">a</span> <span m="4897160">big</span> <span m="4897460">day</span> <span m="4897680">called</span> <span m="4897990">match</span> <span m="4898330">day,</span> <span m="4898980">where you</span> <span m="4899260">get</span> <span m="4899400">assigned</span> <span m="4899910">to</span> <span m="4900080">a</span> <span m="4900150">hospital</span> <span m="4900700">for</span> <span m="4900790">your</span> <span m="4900910">internship,</span> <span m="4902490">and</span> <span m="4902680">the</span> <span m="4902760">way</span> <span m="4902900">that</span> <span m="4903120">works</span> <span m="4903730">is</span> <span m="4904080">using</span> <span m="4904420">this</span> <span m="4904620">algorithm.</span> <span m="4906070">And</span> <span m="4906360">who</span> <span m="4906510">do</span> <span m="4906560">you</span> <span m="4906680">suppose</span> <span m="4907050">is</span> <span m="4907170">the</span> <span m="4907260">boy</span> <span m="4907580">in</span> <span m="4907690">this</span> <span m="4907870">algorithm?</span> </p>
<p><span m="4908390">AUDIENCE: The hospital.</span> </p>
<p><span m="4909150">PROFESSOR: The</span> <span m="4909530">hospital.</span> <span m="4911040">And</span> <span m="4911210">they</span> <span m="4911310">want</span> <span m="4911650">it</span> <span m="4911800">so</span> <span m="4911920">that</span> <span m="4912110">when</span> <span m="4912230">they</span> <span m="4912330">make</span> <span m="4912570">the</span> <span m="4912660">matchings,</span> <span m="4913560">that</span> <span m="4913880">there's</span> <span m="4914200">not</span> <span m="4914440">some</span> <span m="4914760">pair</span> <span m="4915300">of an</span> <span m="4915460">intern</span> <span m="4915970">or</span> <span m="4916080">doctor</span> <span m="4916900">in</span> <span m="4917030">a</span> <span m="4917090">hospital</span> <span m="4917560">where</span> <span m="4917640">they'd</span> <span m="4917750">like</span> <span m="4918000">each</span> <span m="4918140">other</span> <span m="4918300">better</span> <span m="4918630">than</span> <span m="4918750">what</span> <span m="4918910">they</span> <span m="4919030">got.</span> <span m="4920810">This</span> <span m="4920980">is</span> <span m="4921100">used</span> <span m="4921440">in</span> <span m="4921540">online</span> <span m="4922010">dating</span> <span m="4922590">for</span> <span m="4922740">the</span> <span m="4922900">obvious</span> <span m="4923280">reasons,</span> <span m="4924250">and</span> <span m="4924480">we</span> <span m="4924590">actually</span> <span m="4924920">use</span> <span m="4925100">this</span> <span m="4925290">algorithm</span> <span m="4925660">lot</span> <span m="4925980">at</span> <span m="4926100">Akamai</span> <span m="4926670">to</span> <span m="4926770">load</span> <span m="4927040">balance</span> <span m="4927450">traffic</span> <span m="4927910">on</span> <span m="4928040">the</span> <span m="4928130">web.</span> </p>
<p><span m="4929330">And</span> <span m="4929700">here</span> <span m="4929980">you</span> <span m="4930110">have</span> <span m="4930560">the</span> <span m="4930640">boys</span> <span m="4931200">are</span> <span m="4931800">web</span> <span m="4932030">servers,</span> <span m="4933420">and</span> <span m="4933880">the</span> <span m="4933950">girls</span> <span m="4934510">are</span> <span m="4934810">requests</span> <span m="4935790">for</span> <span m="4935920">service.</span> <span m="4937200">And</span> <span m="4937610">the</span> <span m="4937690">goals</span> <span m="4938110">are</span> <span m="4938260">to</span> <span m="4938340">balance</span> <span m="4939630">performance,</span> <span m="4940960">getting</span> <span m="4941180">a</span> <span m="4941240">server</span> <span m="4941550">that's</span> <span m="4941760">nearby</span> <span m="4942180">you</span> <span m="4942290">that's</span> <span m="4942490">fast.</span> <span m="4943360">And</span> <span m="4944010">on</span> <span m="4944120">the</span> <span m="4944220">other</span> <span m="4944400">side,</span> <span m="4944900">our</span> <span m="4945150">cost,</span> <span m="4946600">and</span> <span m="4946810">by</span> <span m="4947020">who</span> <span m="4947190">we</span> <span m="4947350">make</span> <span m="4947810">a</span> <span m="4947890">boy</span> <span m="4948170">and</span> <span m="4948270">a</span> <span m="4948370">girl,</span> <span m="4948740">we</span> <span m="4948860">can</span> <span m="4949010">trade</span> <span m="4949310">off</span> <span m="4950080">cost</span> <span m="4950510">for</span> <span m="4950620">performance</span> <span m="4951690">in</span> <span m="4951820">a</span> <span m="4951850">very</span> <span m="4952170">nice,</span> <span m="4952430">distributed</span> <span m="4952880">way.</span> <span m="4953210">All</span> <span m="4953570">right,</span> <span m="4953910">so</span> <span m="4954000">that's</span> <span m="4954230">it</span> <span m="4954350">for today.</span> </p>
</div>
        <div id="vid_transcript" itemprop="description" class="tabContent hide">
<h2 class="subhead">Free Downloads</h2>
<h3 class="subsubhead">Video</h3>
<ul>
<li>iTunes U (<a href="http://itunes.apple.com/us/itunes-u/lecture-7-matching-problems/id503873536?i=110644963">MP4 - 180MB</a>)</li>
<li>Internet Archive (<a href="http://www.archive.org/download/MIT6.042JF10/MIT6_042JF10_lec07_300k.mp4">MP4 - 180MB</a>)</li>
</ul>
<br>
<h3 class="subsubhead">Caption</h3>
<ul>
<li>English-US (<a href="../../../contents/video-lectures/lecture-7-matching-problems/5RSMLgy06Ew.srt">SRT</a>)</li>
</ul>
</div>
    
   </div>  




      					 
        <div class="" id="parent-fieldname-bottom_html_area">
            
            
        </div>
    
               </main><!--Course_inner_media tag close -->
           		</div>
<!--Course_wrapper tag close -->
            </div>
<!--left tag close -->
            <aside id="right">
                <!--Begin Right Portion -->
                    <div>
    



</div>

                	<div>
    



</div>


        <div class="" id="parent-fieldname-rsi_top_html_area">
            
            
        </div>
    

<!-- RSI google ad space-->



<div id="google_ads">    
    <script async="async" src="https://www.googletagservices.com/tag/js/gpt.js"></script>
    <script type="text/javascript">var googletag = googletag || {}; googletag.cmd = googletag.cmd || [];</script>
    <script type="text/javascript">
googletag.cmd.push(function() {googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_A_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_A_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_B_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_B_DL').addService(googletag.pubads());googletag.defineSlot('/1064917/VIDEO_INDIVIDUAL_SLOT_C_DL', [[300, 250], [300, 300], [180, 200], [180, 150], [160, 600]], 'VIDEO_INDIVIDUAL_SLOT_C_DL').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
 googletag.enableServices();
});</script>
    <script language="javascript" type="text/javascript">
googletag.cmd.push(function() {googletag.pubads().set("TYPE","HOUSE");googletag.pubads().set("DEPARTMENT","6");googletag.pubads().set("CRS_BEG2","04");googletag.pubads().set("CRS_END","2J");googletag.pubads().set("SESSION","F");googletag.pubads().set("YEAR","10");})
</script>
    
    <div id="VIDEO_INDIVIDUAL_SLOT_A_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_A_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_B_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_B_DL'); });</script>
    </div>
    <div id="VIDEO_INDIVIDUAL_SLOT_C_DL">
    	<script>googletag.cmd.push(function() { googletag.display('VIDEO_INDIVIDUAL_SLOT_C_DL'); });</script>
    </div>
</div>

<!-- End RSI ads--> 


<div>
    



</div>

            </aside><!--Right div close -->
            <div class="clear"></div>
        </div>
<!--grid tag close -->
      </div>
		
		<footer id="bottom">
			<div id="grid">
				
<div id="portletwrapper-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572" class="portletWrapper kssattr-portlethash-6f63772e626f74746f6d706f72746c65746d616e616765720a636f6e746578740a2f506c6f6e650a736974652d666f6f746572">
<div class="portletStaticText portlet-static-site-footer"><div id="footer">
<nav aria-label="Footer">     <nav id="foot-c1" class="grid_2 alpha" aria-labelledby="f-find-courses">       <span class="footer" id="f-find-courses" aria-hidden="true">Find Courses</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/courses/find-by-topic/">Find by Topic</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-number/">Find by Course Number</a></li>
    <li><a href="https://ocw.mit.edu/courses/find-by-department/">Find by Department</a></li>
    <li><a href="https://ocw.mit.edu/courses/new-courses/">New Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/most-visited-courses/">Most Visited Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/ocw-scholar/">OCW Scholar Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/audio-video-courses/">Audio/Video Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/online-textbooks/">Online Textbooks</a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights</a></li>
    <li><a href="https://ocw.mit.edu/resources/">Supplemental Resources</a></li>
    <li><a href="https://ocw.mit.edu/courses/mitx-related-courseware/">MITx &amp; Related OCW Courses</a></li>
    <li><a href="https://ocw.mit.edu/courses/mit-open-learning-library/">MIT Open Learning Library</a></li>
    <li><a href="https://ocw.mit.edu/courses/translated-courses/">Translated Courses</a></li>
</ul>
</nav>
<div id="foot-c2" class="grid_2"><nav aria-labelledby="f-for-educators">         <span id="f-for-educators" class="footer" aria-hidden="true">For Educators</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://chalk-radio.simplecast.com/">Chalk Radio Podcast</a></li>
    <li><a href="https://ocw.mit.edu/educator/">OCW Educator Portal </a></li>
    <li><a href="https://ocw.mit.edu/courses/instructor-insights/">Instructor Insights by Department</a></li>
    <li><a href="https://openlearning.mit.edu/campus/digital-innovations/" aria-label="External Link: Residential Digital Innovations">Residential Digital Innovations </a></li>
    <li><a href="https://ocw.mit.edu/high-school/">OCW Highlights for High School</a></li>
    <li><a href="https://ocw.mit.edu/educator/additional-resources/">Additional Resources</a></li>
</ul>
</nav></div>
<nav class="grid_2" id="foot-c3" aria-labelledby="f-donate">       <span id="f-donate" class="footer" aria-hidden="true">Give Now</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/give/">Make a Donation</a></li>
    <li><a href="https://ocw.mit.edu/give/why-give/">Why Give?</a></li>
    <li><a href="https://ocw.mit.edu/give/our-supporters/">Our Supporters</a></li>
    <li><a href="https://ocw.mit.edu/give/other-ways-to-contribute/">Other Ways to Contribute</a></li>
    <li><a href="https://ocw.mit.edu/support/">Become a Corporate Sponsor</a></li>
</ul>
</nav>
<div class="grid_2" id="foot-c4">
<nav aria-labelledby="f-about">         <span id="f-about" class="footer" aria-hidden="true">About</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/about/">About OpenCourseWare</a></li>
    <li><a href="https://ocw.mit.edu/about/site-statistics/">Site Statistics</a></li>
    <li><a href="https://ocw.mit.edu/about/ocw-stories/">OCW Stories</a></li>
    <li><a href="https://ocw.mit.edu/about/newsletter/">Newsletter</a></li>
    <li><a href="https://www.ocw-openmatters.org/">Open Matters Blog</a></li>
</ul>
</nav><!--about-->       <nav aria-labelledby="f-tools">         <span id="f-tools" class="footer" aria-hidden="true">Tools</span>
<ul class="foot-bullet" role="presentation">
    <li><a href="https://ocw.mit.edu/help/">Help &amp; FAQs</a></li>
    <li><a href="https://ocw.mit.edu/about/contactus">Contact Us</a></li>
    <li><a href="https://accessibility.mit.edu/" target="_blank">Accessibility</a></li>
    <li><a href="https://ocw.mit.edu/help/site-map/">Site Map</a></li>
    <li><a href="../../../common/terms/index.htm">Privacy &amp; Terms of Use</a></li>
    <li><a href="https://ocw.mit.edu/help/rss/">RSS Feeds</a></li>
</ul>
</nav><!--tools-->
</div>
</nav> <aside style="min-height: 289px;" aria-labelledby="f-our-corporate-supporters" class="grid_4 omega" id="foot-c5">           <span aria-hidden="true" class="footer" id="f-our-corporate-supporters">Our Corporate Supporters</span>           <!-- HOME_CORP_LOGO_1 -->
<div id="div-gpt-ad-1388181177156-0" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-0'); });
            </script></div>
<!-- HOME_CORP_LOGO_2 -->
<div id="div-gpt-ad-1388181177156-1" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-1'); });
            </script></div>
<!-- HOME_CORP_LOGO_3 -->
<div id="div-gpt-ad-1388181177156-2" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-2'); });
            </script></div>
<!-- HOME_CORP_LOGO_4 -->
<div id="div-gpt-ad-1388181177156-3" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-3'); });
            </script></div>
<!-- HOME_CORP_LOGO_5 -->
<div id="div-gpt-ad-1388181177156-4" class="sponsors_google_ads_even"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-4'); });
              </script></div>
<!-- HOME_CORP_LOGO_6 -->
<div id="div-gpt-ad-1388181177156-5" class="sponsors_google_ads_odd"><script type="text/javascript">
              googletag.cmd.push(function() { googletag.display('div-gpt-ad-1388181177156-5'); });
              </script></div>
</aside>
<div class="grid_12 alpha omega" itemprop="publisher" itemscope="" itemtype="http://schema.org/CollegeOrUniversity">
<h4 class="footer" style="border-top: thin solid #d5c9ba; padding-top: 10px; margin-bottom: 10px;">About <span itemprop="name">MIT OpenCourseWare</span>
</h4>
<p style="color: #999; font-size: 1em; line-height: 1.5em; margin-top: 10px;" itemprop="description">MIT OpenCourseWare is an online publication of materials from over 2,500 MIT courses, freely sharing knowledge with learners and educators around the world. <a href="https://ocw.mit.edu/about/">Learn more »</a></p>
</div>
<div id="foot-copy" class="grid_12 alpha omega" style="border-top: none;">
<a href="http://web.mit.edu"><img src="../../../common/images/logo_mit.png" alt="Massachusetts Institute of Technology logo and name." style="width: 195; height: 44;"></a><a href="https://openlearning.mit.edu/"><img src="https://ocw.mit.edu/images/mitol_logo.png" alt="MIT Open Learning logo and name." style="width: 265; height: 50; vertical-align: top; padding-left:30px;"></a><a href="https://www.oeglobal.org/"><img src="https://ocw.mit.edu/images/oeg_logo.gif" alt="Open Education Consortium logo." style="width: 219px; height: 59px; vertical-align: top; padding-left:20px;"></a><a rel="license" itemprop="useRightsUrl" href="http://creativecommons.org/licenses/by-nc-sa/4.0/"><img src="../../../common/images/cc_by-nc-sa.png" alt="Creative Commons logo with terms BY-NC-SA." style="width: 126px; height: 44px; margin-right: 0; padding-left: 20px;"></a>
<p class="copyright">© 2001–2018<br>
Massachusetts Institute of Technology</p>
<p style="font-size: 0.9em; margin-bottom: 15px;">Your use of the MIT OpenCourseWare site and materials is subject to our <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="license">Creative Commons License</a> and other <a href="../../../common/terms/index.htm" rel="cc:morePermissions">terms of use</a>.</p>
</div>
</div></div>

</div>





                
			</div> <!-- bottom grid end -->
		</footer><!-- footer bottom end -->


   </body>
 </html>
